From 5ddf70a671495a9d90181f11679582b609068ef1 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 4 Apr 2014 16:18:51 -0400 Subject: [PATCH] closes #1273 --- public/src/modules/navigator.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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);