aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-28 23:03:18 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-01-16 22:39:26 -0500
commitd4296a34cca1f4eeb84fec53608a7e5c6b9b9fb1 (patch)
treeee816a18bb1ef9dffa321f661cab195b6a1309d2 /ext/mixed/js
parent0b1bee8c00252b4412ab0d2f88b17d7a2b63bc0b (diff)
Fix scroll position when header is visible
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/display.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 75b43aa0..50e099f6 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -552,6 +552,11 @@ class Display {
target = scroll;
} else {
target = this.index === 0 || entry === null ? 0 : Display.getElementTop(entry);
+
+ const header = document.querySelector('#navigation-header');
+ if (header !== null) {
+ target -= header.getBoundingClientRect().height;
+ }
}
if (smooth) {