From e0ffa6a14d3bba923c7c18a9ab21f95d5151019d Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 5 Jan 2024 14:18:50 +0000 Subject: [PATCH] Account for content pages without content or a scroll indicator --- static/src/js/content.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/static/src/js/content.js b/static/src/js/content.js index 14c420b..d5cd2eb 100644 --- a/static/src/js/content.js +++ b/static/src/js/content.js @@ -23,11 +23,13 @@ function handleScrollIndicator() { } window.addEventListener("load", () => { - window.addEventListener("resize", handleScrollIndicator); - window.addEventListener("scroll", handleScrollIndicator); + if (CONTENT && SCROLL_INDICATOR) { + window.addEventListener("resize", handleScrollIndicator); + window.addEventListener("scroll", handleScrollIndicator); + + // Initialize the indicator + handleScrollIndicator(); + } GLightbox({}); - - // Initialize the indicator - handleScrollIndicator(); });