From 0c3e79cd94966f2adf408c4d933fa8e4b386b3de Mon Sep 17 00:00:00 2001 From: Adrian Rosin Date: Fri, 9 Feb 2024 09:49:22 +0100 Subject: [PATCH] added noindex for robots --- static/index.html | 1 + static/script-bon.js | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/static/index.html b/static/index.html index 85be89a..6bfb01e 100644 --- a/static/index.html +++ b/static/index.html @@ -7,6 +7,7 @@ --> + diff --git a/static/script-bon.js b/static/script-bon.js index 87cf859..5d09dd1 100644 --- a/static/script-bon.js +++ b/static/script-bon.js @@ -116,10 +116,10 @@ async function setupPage() { } let lastScrollTop = 0; - let isScrolling = false; + let isCallbackRegistered = false; window.addEventListener("scroll", function() { - if (!isScrolling) { + if (!isCallbackRegistered) { window.requestAnimationFrame(function() { let currentPosition = window.scrollY || document.documentElement.scrollTop; const toggleButton = document.querySelectorAll('.toggleButton'); @@ -135,12 +135,11 @@ async function setupPage() { button.style.display = "block"; }); } - lastScrollTop = currentPosition <= 0 ? 0 : currentPosition; // For Mobile or negative scrolling - isScrolling = false; + isCallbackRegistered = false; }); - isScrolling = true; + isCallbackRegistered = true; } }); }