From b1b09f1bb89dbdb65282582743b2004203a5f21b Mon Sep 17 00:00:00 2001 From: Mottie Date: Sun, 22 Jun 2014 06:37:02 -0500 Subject: [PATCH] Pager: prev & next buttons now disable with 0 filtered pages. Fixes #649 --- addons/pager/jquery.tablesorter.pager.js | 2 +- js/widgets/widget-pager.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index 8c528a3d..5d2887a7 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -121,7 +121,7 @@ dis = !!disable, first = ( dis || p.page === 0 ), tp = Math.min( p.totalPages, p.filteredPages ), - last = ( dis || (p.page === tp - 1) || p.totalPages === 0 ); + last = ( dis || (p.page === tp - 1) || tp === 0 ); if ( p.updateArrows ) { p.$container.find(p.cssFirst + ',' + p.cssPrev)[ first ? a : r ](d).attr('aria-disabled', first); p.$container.find(p.cssNext + ',' + p.cssLast)[ last ? a : r ](d).attr('aria-disabled', last); diff --git a/js/widgets/widget-pager.js b/js/widgets/widget-pager.js index 9a256ed1..2198a39e 100644 --- a/js/widgets/widget-pager.js +++ b/js/widgets/widget-pager.js @@ -322,7 +322,7 @@ tsp = ts.pager = { dis = !!disable, first = dis || p.page === 0, tp = Math.min( p.totalPages, p.filteredPages ), - last = dis || p.page === tp - 1 || p.totalPages === 0, + last = dis || p.page === tp - 1 || tp === 0, wo = c.widgetOptions, s = wo.pager_selectors; if ( wo.pager_updateArrows ) {