mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
fix #4452: default to scroll to my post
This commit is contained in:
@@ -50,7 +50,7 @@ define('forum/topic/posts', [
|
||||
|
||||
function onNewPostPagination(data) {
|
||||
function scrollToPost() {
|
||||
if (config.scrollToMyPost) {
|
||||
if (ajaxify.data.scrollToMyPost) {
|
||||
scrollToPostIfSelf(data.posts[0]);
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ define('forum/topic/posts', [
|
||||
|
||||
if (isPostVisible) {
|
||||
createNewPosts(data, components.get('post').not('[data-index=0]'), direction, scrollToPost);
|
||||
} else if (config.scrollToMyPost && parseInt(posts[0].uid, 10) === parseInt(app.user.uid, 10)) {
|
||||
} else if (ajaxify.data.scrollToMyPost && parseInt(posts[0].uid, 10) === parseInt(app.user.uid, 10)) {
|
||||
pagination.loadPage(ajaxify.data.pagination.pageCount, scrollToPost);
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ define('forum/topic/posts', [
|
||||
}
|
||||
|
||||
function scrollToPostIfSelf(post) {
|
||||
if (!config.scrollToMyPost) {
|
||||
if (!ajaxify.data.scrollToMyPost) {
|
||||
return;
|
||||
}
|
||||
var isSelfPost = parseInt(post.uid, 10) === parseInt(app.user.uid, 10);
|
||||
@@ -265,4 +265,4 @@ define('forum/topic/posts', [
|
||||
|
||||
return Posts;
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user