From 54f07f5a90074d1fe715305b3d102469a1b508c5 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 25 Oct 2014 10:03:32 +0200 Subject: [PATCH] Fixed scrolling to top when endless scroll enabled --- public_html/js/Presenters/GlobalCommentListPresenter.js | 1 - public_html/js/Presenters/PagerPresenter.js | 1 + public_html/js/Presenters/PostListPresenter.js | 1 - public_html/js/Presenters/TagListPresenter.js | 1 - public_html/js/Presenters/UserListPresenter.js | 1 - 5 files changed, 1 insertion(+), 4 deletions(-) diff --git a/public_html/js/Presenters/GlobalCommentListPresenter.js b/public_html/js/Presenters/GlobalCommentListPresenter.js index 983c2448..40da71c2 100644 --- a/public_html/js/Presenters/GlobalCommentListPresenter.js +++ b/public_html/js/Presenters/GlobalCommentListPresenter.js @@ -84,7 +84,6 @@ App.Presenters.GlobalCommentListPresenter = function( $target.append($post); }); - window.scrollTo(0, 0); } return { diff --git a/public_html/js/Presenters/PagerPresenter.js b/public_html/js/Presenters/PagerPresenter.js index 91730f37..26232372 100644 --- a/public_html/js/Presenters/PagerPresenter.js +++ b/public_html/js/Presenters/PagerPresenter.js @@ -94,6 +94,7 @@ App.Presenters.PagerPresenter = function( if (forceClear || !endlessScroll) { clearContent(); + window.scrollTo(0, 0); } var $page = jQuery('
'); if (endlessScroll && pager.getTotalPages() > 1) { diff --git a/public_html/js/Presenters/PostListPresenter.js b/public_html/js/Presenters/PostListPresenter.js index db458b70..fa0fbc5f 100644 --- a/public_html/js/Presenters/PostListPresenter.js +++ b/public_html/js/Presenters/PostListPresenter.js @@ -113,7 +113,6 @@ App.Presenters.PostListPresenter = function( } }); windowResized(); - window.scrollTo(0, 0); } function shouldSkipPost(post) { diff --git a/public_html/js/Presenters/TagListPresenter.js b/public_html/js/Presenters/TagListPresenter.js index c1f16b1f..1f881669 100644 --- a/public_html/js/Presenters/TagListPresenter.js +++ b/public_html/js/Presenters/TagListPresenter.js @@ -120,7 +120,6 @@ App.Presenters.TagListPresenter = function( })); $target.append($item); }); - window.scrollTo(0, 0); } return { diff --git a/public_html/js/Presenters/UserListPresenter.js b/public_html/js/Presenters/UserListPresenter.js index e1c16083..f4e531c1 100644 --- a/public_html/js/Presenters/UserListPresenter.js +++ b/public_html/js/Presenters/UserListPresenter.js @@ -78,7 +78,6 @@ App.Presenters.UserListPresenter = function( $target.append($item); }); _.map(_.map($target.find('img'), jQuery), util.loadImagesNicely); - window.scrollTo(0, 0); } return {