diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2022-12-07 07:30:48 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2022-12-07 07:30:48 -0400 |
commit | f18ddd61d7430f82116b7f6003e68a548f39f766 (patch) | |
tree | a424f5145b759b765eff22498019a5b16e79272a /src/static | |
parent | 0735a45e0ddf693e35202c7c3ef3c15886139843 (diff) |
more sticky heading adjustments
Diffstat (limited to 'src/static')
-rw-r--r-- | src/static/client.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/static/client.js b/src/static/client.js index dcb39226..15f21fdb 100644 --- a/src/static/client.js +++ b/src/static/client.js @@ -487,10 +487,12 @@ function updateStickyHeading() { } of stickyHeadingInfo) { let closestHeading = null; - if (contentCover.getBoundingClientRect().bottom < 0) { - stickyCoverContainer.classList.add('visible'); - } else { - stickyCoverContainer.classList.remove('visible'); + if (contentCover && stickyCoverContainer) { + if (contentCover.getBoundingClientRect().bottom < 0) { + stickyCoverContainer.classList.add('visible'); + } else { + stickyCoverContainer.classList.remove('visible'); + } } if (topOfViewInside(contentContainer)) { |