Skip to content

Node.js based forum software built for the modern web

closes #2051

barisusakli273db693e764
diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index 5098d66d5d..6c0ece91df 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -212,6 +212,10 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
};
Topic.navigatorCallback = function(element, elementCount) {
+ var path = ajaxify.removeRelativePath(window.location.pathname.slice(1));
+ if (!path.startsWith('topic')) {
+ return 1;
+ }
var postIndex = parseInt(element.attr('data-index'), 10);
var index = postIndex + 1;
if (config.topicPostSort !== 'oldest_to_newest') {
diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js
index 3392a7bd83..0d62b52b00 100644
--- a/public/src/modules/navigator.js
+++ b/public/src/modules/navigator.js
@@ -24,6 +24,12 @@ define('navigator', ['forum/pagination'], function(pagination) {
e.stopPropagation();
});
+ $('.pagination-block').off('shown.bs.dropdown', '.dropdown').on('shown.bs.dropdown', '.dropdown', function() {
+ setTimeout(function() {
+ $('.pagination-block input').focus();
+ }, 100);
+ });
+
$('.pagination-block .pageup').off('click').on('click', navigator.scrollUp);
$('.pagination-block .pagedown').off('click').on('click', navigator.scrollDown);
$('.pagination-block .pagetop').off('click').on('click', toTop);
@@ -72,6 +78,11 @@ define('navigator', ['forum/pagination'], function(pagination) {
};
function toggle(flag) {
+ var path = ajaxify.removeRelativePath(window.location.pathname.slice(1));
+ if (flag && (!path.startsWith('topic') && !path.startsWith('category'))) {
+ return;
+ }
+
$('.pagination-block').toggleClass('hidden', !flag);
}
diff --git a/public/src/utils.js b/public/src/utils.js
index 28973b9c8d..104f8e4f6d 100644
--- a/public/src/utils.js
+++ b/public/src/utils.js
@@ -359,6 +359,16 @@
}
};
+ if (typeof String.prototype.startsWith != 'function') {
+ String.prototype.startsWith = function (prefix){
+ if (this.length < prefix.length)
+ return false;
+ for (var i = prefix.length - 1; (i >= 0) && (this[i] === prefix[i]); --i)
+ continue;
+ return i < 0;
+ };
+ }
+
if ('undefined' !== typeof window) {
window.utils = module.exports;
}