Skip to content

Commit

Permalink
Merge pull request #38 from BenjSta/fix_scroll_behavior
Browse files Browse the repository at this point in the history
scroll to top when next or previous page is displayed
  • Loading branch information
faroit authored May 20, 2020
2 parents bb12dcb + 61e3540 commit 3601e3e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/webmushra/business/PageManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ PageManager.prototype.nextPage = function () {
if (this.getCurrentPage().load !== undefined) {
$("#"+id).append($("<script> " + this.getPageVariableName(this.getCurrentPage()) + ".load();</script>"));
}
window.scrollTo(0, 0);
} else {
--this.pagesIndex;
}
Expand All @@ -85,6 +86,7 @@ PageManager.prototype.previousPage = function () {
if (this.getCurrentPage().load !== undefined) {
$("#"+id).append($("<script> " + this.getPageVariableName(this.getCurrentPage()) + ".load();</script>"));
}
window.scrollTo(0, 0);
} else {
++this.pagesIndex;
}
Expand Down

0 comments on commit 3601e3e

Please sign in to comment.