« get me outta code hell

more sticky heading adjustments - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static
diff options
context:
space:
mode:
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
commitf18ddd61d7430f82116b7f6003e68a548f39f766 (patch)
treea424f5145b759b765eff22498019a5b16e79272a /src/static
parent0735a45e0ddf693e35202c7c3ef3c15886139843 (diff)
more sticky heading adjustments
Diffstat (limited to 'src/static')
-rw-r--r--src/static/client.js10
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)) {