diff options
Diffstat (limited to 'public/js/app.js')
-rw-r--r-- | public/js/app.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/public/js/app.js b/public/js/app.js index cbf5f07..e8d8934 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -26,13 +26,13 @@ url = window.location.href.split('#')[0]; */ var settings = { pager: {} }; -window.addEventListener('load', function(event) { +window.addEventListener('DOMContentLoaded', function(event) { if (history.scrollRestoration) { history.scrollRestoration = 'manual'; } if (localStorage['settings']) { settings = JSON.parse(localStorage['settings']); } if (window.location.href.indexOf("#") >= 0) { settings['pager'][url] = window.pageYOffset; localStorage['settings'] = JSON.stringify(settings); - document.getElementById(location.hash.slice(1)).scrollIntoView() + document.getElementById(location.hash.slice(1)).scrollIntoView(); return; } if (settings['pager'][url] > 0) { window.scrollTo(0, settings['pager'][url]); return; } |