mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
closes #2634
This commit is contained in:
@@ -31,11 +31,18 @@ define('forum/topic/posts', [
|
||||
};
|
||||
|
||||
function onNewPostPagination(data) {
|
||||
function scrollToPost() {
|
||||
navigator.scrollBottom(data.posts[0].index);
|
||||
}
|
||||
|
||||
var posts = data.posts;
|
||||
|
||||
pagination.pageCount = Math.max(1, Math.ceil((posts[0].topic.postcount - 1) / config.postsPerPage));
|
||||
|
||||
if (pagination.currentPage === pagination.pageCount) {
|
||||
createNewPosts(data);
|
||||
} else if(data.posts && data.posts.length && parseInt(data.posts[0].uid, 10) === parseInt(app.user.uid, 10)) {
|
||||
pagination.loadPage(pagination.pageCount);
|
||||
createNewPosts(data, scrollToPost);
|
||||
} else if (parseInt(posts[0].uid, 10) === parseInt(app.user.uid, 10)) {
|
||||
pagination.loadPage(pagination.pageCount, scrollToPost);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user