mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-04 21:59:51 +01:00
closes #5190
This commit is contained in:
@@ -99,6 +99,11 @@ define('forum/topic/posts', [
|
||||
function onNewPostInfiniteScroll(data) {
|
||||
var direction = config.topicPostSort === 'oldest_to_newest' || config.topicPostSort === 'most_votes' ? 1 : -1;
|
||||
|
||||
var isPreviousPostAdded = $('[component="post"][data-index="' + (data.posts[0].index - 1) + '"]').length;
|
||||
if (!isPreviousPostAdded && (!data.posts[0].selfPost || !ajaxify.data.scrollToMyPost)) {
|
||||
return;
|
||||
}
|
||||
|
||||
createNewPosts(data, components.get('post').not('[data-index=0]'), direction, function (html) {
|
||||
if (html) {
|
||||
html.addClass('new');
|
||||
@@ -109,11 +114,7 @@ define('forum/topic/posts', [
|
||||
}
|
||||
|
||||
function scrollToPostIfSelf(post) {
|
||||
if (!ajaxify.data.scrollToMyPost) {
|
||||
return;
|
||||
}
|
||||
var isSelfPost = parseInt(post.uid, 10) === parseInt(app.user.uid, 10);
|
||||
if (isSelfPost) {
|
||||
if (post.selfPost && ajaxify.data.scrollToMyPost) {
|
||||
navigator.scrollBottom(post.index);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user