aboutsummaryrefslogtreecommitdiff
path: root/public/js/app.js
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2020-09-23 17:19:37 -0400
committerThedro Neely <thedroneely@gmail.com>2020-09-23 18:48:03 -0400
commitb34901da6d12aff4a6541108c5e57a779dc7fbaa (patch)
tree956ded952dfd3f24e25ef66cb35a981c4060e365 /public/js/app.js
parent014b6fdf640a1bb6f98e5ae59856c3bdf971ac65 (diff)
downloadthedroneely.com-b34901da6d12aff4a6541108c5e57a779dc7fbaa.tar.gz
thedroneely.com-b34901da6d12aff4a6541108c5e57a779dc7fbaa.tar.bz2
thedroneely.com-b34901da6d12aff4a6541108c5e57a779dc7fbaa.zip
public/js/app: Pager ignore '#' in url
Diffstat (limited to 'public/js/app.js')
-rw-r--r--public/js/app.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/public/js/app.js b/public/js/app.js
index 8930a6c..a4a40ce 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -25,9 +25,10 @@ window.history.replaceState(null, null, url);
var settings = { pager: {} };
window.addEventListener('load', function(event) {
+ if (url.indexOf("#") >= 0) { return; }
if (localStorage['settings']) { settings = JSON.parse(localStorage['settings']); }
- if (settings['pager'][window.location.href]) { window.scrollTo(0, settings['pager'][window.location.href]); return; }
- settings['pager'][window.location.href] = 0;
+ if (settings['pager'][url]) { window.scrollTo(0, settings['pager'][url]); return; }
+ settings['pager'][url] = 1;
localStorage['settings'] = JSON.stringify(settings);
});
@@ -113,7 +114,7 @@ window.addEventListener('scroll', function(event) {
var currentPosition = window.pageYOffset;
var velocity = previousPosition - currentPosition;
- settings['pager'][window.location.href] = currentPosition;
+ settings['pager'][url] = currentPosition;
if (scrolls > 3) {
if (velocity > 75 || currentPosition < navbarHeight) {