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