Skip to content

Node.js based forum software built for the modern web

fix #4452: default to scroll to my post

boomzillawtf6aa0f8eb8a22
diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js
index dbe2eddf16..3256f4d2f0 100644
--- a/public/src/client/topic/posts.js
+++ b/public/src/client/topic/posts.js
@@ -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;
-});
\ No newline at end of file
+});
diff --git a/src/user/settings.js b/src/user/settings.js
index fc72342bf9..ee8bcb0189 100644
--- a/src/user/settings.js
+++ b/src/user/settings.js
@@ -76,7 +76,7 @@ module.exports = function(User) {
settings.restrictChat = parseInt(getSetting(settings, 'restrictChat', 0), 10) === 1;
settings.topicSearchEnabled = parseInt(getSetting(settings, 'topicSearchEnabled', 0), 10) === 1;
settings.bootswatchSkin = settings.bootswatchSkin || 'default';
- settings.scrollToMyPost = parseInt(getSetting(settings, 'scrollToMyPost', 1), 10) ===1;
+ settings.scrollToMyPost = parseInt(getSetting(settings, 'scrollToMyPost', 1), 10) != 0;
callback(null, settings);
});