diff --git a/public/src/app.js b/public/src/app.js index bc583e2b17..c6ad9c7305 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -528,6 +528,10 @@ var socket, }); templates.setGlobal('relative_path', RELATIVE_PATH); + templates.setGlobal('usePagination', config.usePagination); + templates.setGlobal('topicsPerPage', config.topicsPerPage); + templates.setGlobal('postsPerPage', config.postsPerPage); + console.log(templates.globals); }); showWelcomeMessage = location.href.indexOf('loggedin') !== -1; diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index a48d8c82cf..62ded4c4ce 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -355,15 +355,27 @@ define(['composer'], function(composer) { }); function enableInfiniteLoading() { - $(window).off('scroll').on('scroll', function() { - var bottom = ($(document).height() - $(window).height()) * 0.9; + if(!config.usePagination) { + $(window).off('scroll').on('scroll', function() { + var bottom = ($(document).height() - $(window).height()) * 0.9; - if ($(window).scrollTop() > bottom && !infiniteLoaderActive && $('#post-container').children().length) { - loadMorePosts(tid, function(posts) { - fixDeleteStateForPosts(); - }); - } - }); + if ($(window).scrollTop() > bottom && !infiniteLoaderActive && $('#post-container').children().length) { + loadMorePosts(tid, function(posts) { + fixDeleteStateForPosts(); + }); + } + }); + } else { + $('.pagination .previous').on('click', function() { + + return false; + }); + + $('.pagination .next').on('click', function() { + + return false; + }); + } } $('.topic').on('click', '.post_reply', function() { diff --git a/public/templates/admin/settings.tpl b/public/templates/admin/settings.tpl index 8ddd896da9..3601f7c2ca 100644 --- a/public/templates/admin/settings.tpl +++ b/public/templates/admin/settings.tpl @@ -7,6 +7,7 @@