manage: save scrollY in onbeforeunload (less buggy)

This commit is contained in:
tophf 2017-04-10 10:35:15 +03:00
parent 1df76c6929
commit 8bec1d61bd

View File

@ -61,11 +61,7 @@ function initGlobalEvents() {
}; };
// remember scroll position on normal history navigation // remember scroll position on normal history navigation
document.addEventListener('visibilitychange', () => { window.onbeforeunload = rememberScrollPosition;
if (document.visibilityState != 'visible') {
rememberScrollPosition();
}
});
for (const [className, checkbox] of [ for (const [className, checkbox] of [
['enabled-only', $('#manage.onlyEnabled')], ['enabled-only', $('#manage.onlyEnabled')],