mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
🐛 Fix: bookmark scroll error when scroll top equal 0
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-2
@@ -1018,8 +1018,7 @@ class FixIt {
|
||||
return;
|
||||
}
|
||||
window.addEventListener('beforeunload', () => {
|
||||
const scrollTop = this.util.getScrollTop();
|
||||
scrollTop && window.localStorage?.setItem(`fixit-bookmark/#${location.pathname}`, scrollTop);
|
||||
window.localStorage?.setItem(`fixit-bookmark/#${location.pathname}`, this.util.getScrollTop());
|
||||
});
|
||||
const scrollTop = Number(window.localStorage?.getItem(`fixit-bookmark/#${location.pathname}`));
|
||||
// If the page opens with a specific hash, just jump out
|
||||
|
||||
Reference in New Issue
Block a user