Fixed scrolling to top when endless scroll enabled

This commit is contained in:
Marcin Kurczewski 2014-10-25 10:03:32 +02:00
parent 60f4dd9d4a
commit 54f07f5a90
5 changed files with 1 additions and 4 deletions

View file

@ -84,7 +84,6 @@ App.Presenters.GlobalCommentListPresenter = function(
$target.append($post); $target.append($post);
}); });
window.scrollTo(0, 0);
} }
return { return {

View file

@ -94,6 +94,7 @@ App.Presenters.PagerPresenter = function(
if (forceClear || !endlessScroll) { if (forceClear || !endlessScroll) {
clearContent(); clearContent();
window.scrollTo(0, 0);
} }
var $page = jQuery('<div class="page">'); var $page = jQuery('<div class="page">');
if (endlessScroll && pager.getTotalPages() > 1) { if (endlessScroll && pager.getTotalPages() > 1) {

View file

@ -113,7 +113,6 @@ App.Presenters.PostListPresenter = function(
} }
}); });
windowResized(); windowResized();
window.scrollTo(0, 0);
} }
function shouldSkipPost(post) { function shouldSkipPost(post) {

View file

@ -120,7 +120,6 @@ App.Presenters.TagListPresenter = function(
})); }));
$target.append($item); $target.append($item);
}); });
window.scrollTo(0, 0);
} }
return { return {

View file

@ -78,7 +78,6 @@ App.Presenters.UserListPresenter = function(
$target.append($item); $target.append($item);
}); });
_.map(_.map($target.find('img'), jQuery), util.loadImagesNicely); _.map(_.map($target.find('img'), jQuery), util.loadImagesNicely);
window.scrollTo(0, 0);
} }
return { return {