From 9a81c756f73be0769807b00c397cbe2a3222beb5 Mon Sep 17 00:00:00 2001 From: rozwell Date: Sat, 17 Mar 2012 20:29:48 +0100 Subject: [PATCH] Fixed NaN pager size when cssPageSize is not set. Fixed manual page setting on construct. --- addons/pager/jquery.tablesorter.pager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index 509974e7..8b4842ee 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -136,7 +136,7 @@ }, hideRowsSetup = function(table, c){ - c.size = parseInt($(c.cssPageSize, c.container).val(), 10); + c.size = parseInt($(c.cssPageSize, c.container).val(), 10) || c.size; $.data(table, 'pagerLastSize', c.size); pagerArrows(c); if (!c.removeRows) { @@ -328,8 +328,8 @@ enablePager = function(table, c, triggered){ var p = $(c.cssPageSize, c.container).removeClass(c.cssDisabled).removeAttr('disabled'); c.isDisabled = false; - c.page = $.data(table, 'pagerLastPage') || 0; - c.size = $.data(table, 'pagerLastSize') || parseInt(p.val(), 10); + c.page = $.data(table, 'pagerLastPage') || 0 || c.page; + c.size = $.data(table, 'pagerLastSize') || parseInt(p.val(), 10) || c.size; c.totalPages = Math.ceil(c.totalRows / c.size); if (triggered) { $('table').trigger('update');