From ff9b2bad497fe28fbb79f2b11f5f11fc03bf6ec3 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 18 Apr 2016 16:06:59 +0300 Subject: [PATCH] closes #4512 --- public/src/client/topic.js | 4 ++-- src/controllers/topics.js | 1 + src/views/admin/settings/post.tpl | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/public/src/client/topic.js b/public/src/client/topic.js index ff0a255261..fd6fd7dbfa 100644 --- a/public/src/client/topic.js +++ b/public/src/client/topic.js @@ -143,7 +143,7 @@ define('forum/topic', [ if (components.get('post/anchor', postIndex).length) { return navigator.scrollToPostIndex(postIndex, true); } - } else if (bookmark && (!config.usePagination || (config.usePagination && ajaxify.data.pagination.currentPage === 1)) && ajaxify.data.postcount > 5) { + } else if (bookmark && (!config.usePagination || (config.usePagination && ajaxify.data.pagination.currentPage === 1)) && ajaxify.data.postcount > ajaxify.data.bookmarkThreshold) { navigator.update(0); app.alert({ alert_id: 'bookmark', @@ -280,7 +280,7 @@ define('forum/topic', [ var bookmarkKey = 'topic:' + ajaxify.data.tid + ':bookmark'; var currentBookmark = ajaxify.data.bookmark || localStorage.getItem(bookmarkKey); - if (ajaxify.data.postcount > 5 && (!currentBookmark || parseInt(index, 10) > parseInt(currentBookmark, 10))) { + if (ajaxify.data.postcount > ajaxify.data.bookmarkThreshold && (!currentBookmark || parseInt(index, 10) > parseInt(currentBookmark, 10))) { if (app.user.uid) { socket.emit('topics.bookmark', { 'tid': ajaxify.data.tid, diff --git a/src/controllers/topics.js b/src/controllers/topics.js index c3c2847778..c62ad30545 100644 --- a/src/controllers/topics.js +++ b/src/controllers/topics.js @@ -261,6 +261,7 @@ topicsController.get = function(req, res, callback) { data['reputation:disabled'] = parseInt(meta.config['reputation:disabled'], 10) === 1; data['downvote:disabled'] = parseInt(meta.config['downvote:disabled'], 10) === 1; data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1; + data.bookmarkThreshold = parseInt(meta.config.bookmarkThreshold, 10) || 5; data.scrollToMyPost = settings.scrollToMyPost; data.rssFeedUrl = nconf.get('relative_path') + '/topic/' + data.tid + '.rss'; data.pagination = pagination.create(currentPage, pageCount); diff --git a/src/views/admin/settings/post.tpl b/src/views/admin/settings/post.tpl index 590f0e18cd..e37f51a40c 100644 --- a/src/views/admin/settings/post.tpl +++ b/src/views/admin/settings/post.tpl @@ -100,6 +100,10 @@ +
+ + +