From c147e4e90d8344e0a897f5d3fba0cdb5aaf49c2e Mon Sep 17 00:00:00 2001 From: Thedro Neely Date: Mon, 14 Nov 2022 05:15:03 -0500 Subject: public/js/app: Correct scroll logic --- public/js/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/js/app.js b/public/js/app.js index a7ccbca..059c355 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -87,13 +87,15 @@ window.addEventListener('scroll', function() { settings['pager'][url] = currentPosition; localStorage['settings'] = JSON.stringify(settings); - if ((scrolls > 3 && velocity > 75) || currentPosition < navbarHeight) { + if (scrolls > 3) { + if (velocity > 75 || currentPosition < navbarHeight) { remClass(navbar, 'hide'); } else if (velocity < -25) { addClass(navbar, 'hide'); } else if (currentPosition > navbarHeight) { runOnce(function () { addClass(navbar, 'hide'); }); } + } previousPosition = currentPosition; scrolls++; -- cgit v1.2.3