Diff options
Diffstat (limited to '')
| -rw-r--r-- | assets/cgit.js | 5 |
1 file changed, 3 insertions, 2 deletions
diff --git a/assets/cgit.js b/assets/cgit.js index d09423f..dfe4e3d 100644 --- a/assets/cgit.js +++ b/assets/cgit.js @@ -153,9 +153,10 @@ function place_bar() { table.appendChild(bar); // A browser only scrolls to a fragment that names a real id, which a range - // never does, so bring the start of one into view here. + // never does, so bring the start of one into view here. The scroll margin + // on the anchors centres it the way it centres a single line. if (match[2]) - first.scrollIntoView({ block: "center" }); + first.scrollIntoView(); } document.addEventListener("DOMContentLoaded", place_bar, false); |
