Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Now onScroll uses debounce on saveHistory #233

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,8 @@ class App extends EventEmitter {
* by client code. If so, it replaces with a function that halts the normal
* event flow in relation with the client onbeforeunload function.
* This can be in most part used to prematurely terminate navigation to other pages
* according to the given constrait(s).
* @protected
* according to the given constrait(s).
* @protected
*/
maybeOverloadBeforeUnload_() {
if ('function' === typeof window.onbeforeunload) {
Expand All @@ -702,7 +702,7 @@ class App extends EventEmitter {
}
};

// mark the updated handler due unwanted recursion
// mark the updated handler due unwanted recursion
window.onbeforeunload._overloaded = true;
}
}
Expand Down Expand Up @@ -945,7 +945,7 @@ class App extends EventEmitter {
*/
onScroll_() {
if (this.captureScrollPositionFromScrollEvent) {
this.saveHistoryCurrentPageScrollPosition_(globals.window.pageYOffset, globals.window.pageXOffset);
debounce(this.saveHistoryCurrentPageScrollPosition_(globals.window.pageYOffset, globals.window.pageXOffset), 100);
}
}

Expand Down