Fixed list presenters not scrolling to top
This commit is contained in:
parent
619a0c0cc4
commit
eed2588eb7
4 changed files with 6 additions and 2 deletions
|
@ -33,7 +33,7 @@ App.Presenters.GlobalCommentListPresenter = function(
|
|||
backendUri: '/comments',
|
||||
$target: $el.find('.pagination-target'),
|
||||
updateCallback: function($page, data) {
|
||||
renderPosts($page, data.entities);
|
||||
renderComments($page, data.entities);
|
||||
},
|
||||
},
|
||||
function() {
|
||||
|
@ -59,7 +59,7 @@ App.Presenters.GlobalCommentListPresenter = function(
|
|||
$el.html(templates.list());
|
||||
}
|
||||
|
||||
function renderPosts($page, data) {
|
||||
function renderComments($page, data) {
|
||||
var $target = $page.find('.posts');
|
||||
_.each(data, function(data) {
|
||||
var post = data.post;
|
||||
|
@ -84,6 +84,7 @@ App.Presenters.GlobalCommentListPresenter = function(
|
|||
|
||||
$target.append($post);
|
||||
});
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
@ -113,6 +113,7 @@ App.Presenters.PostListPresenter = function(
|
|||
}
|
||||
});
|
||||
windowResized();
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
|
||||
function shouldSkipPost(post) {
|
||||
|
|
|
@ -120,6 +120,7 @@ App.Presenters.TagListPresenter = function(
|
|||
}));
|
||||
$target.append($item);
|
||||
});
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
@ -78,6 +78,7 @@ App.Presenters.UserListPresenter = function(
|
|||
$target.append($item);
|
||||
});
|
||||
_.map(_.map($target.find('img'), jQuery), util.loadImagesNicely);
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue