mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Added current page info to endless scroll
This commit is contained in:
@ -43,8 +43,8 @@ App.Presenters.PostListPresenter = function(
|
||||
baseUri: '#/posts',
|
||||
backendUri: '/posts',
|
||||
$target: $el.find('.pagination-target'),
|
||||
updateCallback: function(data, clear) {
|
||||
renderPosts(data.entities, clear);
|
||||
updateCallback: function($page, data) {
|
||||
renderPosts($page, data.entities);
|
||||
},
|
||||
},
|
||||
function() {
|
||||
@ -102,13 +102,8 @@ App.Presenters.PostListPresenter = function(
|
||||
_.map($el.find('.posts .post-small'), function(postNode) { softRenderPost(jQuery(postNode).parents('li')); });
|
||||
}
|
||||
|
||||
function renderPosts(posts, clear) {
|
||||
var $target = $el.find('.posts');
|
||||
|
||||
if (clear) {
|
||||
$target.empty();
|
||||
}
|
||||
|
||||
function renderPosts($page, posts) {
|
||||
var $target = $page.find('.posts');
|
||||
_.each(posts, function(post) {
|
||||
var $post = renderPost(post);
|
||||
softRenderPost($post);
|
||||
|
Reference in New Issue
Block a user