Node.js based forum software built for the modern web
closes #4512
barisusakliff9b2bad497f
diff --git a/public/src/client/topic.js b/public/src/client/topic.jsindex 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.jsindex 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.tplindex 590f0e18cd..e37f51a40c 100644--- a/src/views/admin/settings/post.tpl+++ b/src/views/admin/settings/post.tpl@@ -100,6 +100,10 @@<label for="unreadCutoff">Unread cutoff days</label><input id="unreadCutoff" type="text" class="form-control" value="2" data-field="unreadCutoff"></div>+ <div class="form-group">+ <label for="bookmarkthreshold">Minimum posts in topic before tracking last read</label>+ <input id="bookmarkthreshold" type="text" class="form-control" value="5" data-field="bookmarkThreshold">+ </div></form></div></div>