Skip to content

Node.js based forum software built for the modern web

closes #1273

barisusakli5ddf70a67149
diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js
index 8a0aac833a..c6f7aab854 100644
--- a/public/src/modules/navigator.js
+++ b/public/src/modules/navigator.js
@@ -31,23 +31,29 @@ define(function() {
navigator.setCount(count);
navigator.update();
- navigator.show();
};
navigator.setCount = function(value) {
- count = value;
+ count = parseInt(value, 10);
navigator.updateTextAndProgressBar();
};
navigator.show = function() {
- $('.pagination-block').removeClass('hidden');
+ toggle(true);
};
navigator.hide = function() {
- $('.pagination-block').addClass('hidden');
+ toggle(false);
};
+ function toggle(flag) {
+ $('.pagination-block').toggleClass('hidden', !flag);
+ }
+
navigator.update = function() {
+
+ toggle(!!count);
+
$($(navigator.selector).get().reverse()).each(function() {
var el = $(this);