mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
closes #3597
This commit is contained in:
@@ -18,6 +18,10 @@ define('forum/topic/posts', [
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data || !data.posts || !data.posts.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (config.usePagination) {
|
||||
return onNewPostPagination(data);
|
||||
}
|
||||
@@ -32,13 +36,20 @@ define('forum/topic/posts', [
|
||||
if (html) {
|
||||
html.addClass('new');
|
||||
}
|
||||
navigator.scrollBottom(data.posts[0].index);
|
||||
scrollToPostIfSelf(data.posts[0]);
|
||||
});
|
||||
};
|
||||
|
||||
function scrollToPostIfSelf(post) {
|
||||
var isSelfPost = parseInt(post.uid, 10) === parseInt(app.user.uid, 10);
|
||||
if (isSelfPost) {
|
||||
navigator.scrollBottom(post.index);
|
||||
}
|
||||
}
|
||||
|
||||
function onNewPostPagination(data) {
|
||||
function scrollToPost() {
|
||||
navigator.scrollBottom(data.posts[0].index);
|
||||
scrollToPostIfSelf(data.posts[0]);
|
||||
}
|
||||
|
||||
var posts = data.posts;
|
||||
|
||||
Reference in New Issue
Block a user