fix #4452: default to scroll to my post

This commit is contained in:
boomzillawtf
2016-03-23 21:37:48 -04:00
parent 3d0012d730
commit 6aa0f8eb8a
2 changed files with 5 additions and 5 deletions

View File

@@ -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;
});
});