From 404567f533c2cd0c83d17ea75e790ac53a8a57d1 Mon Sep 17 00:00:00 2001 From: Mottie Date: Thu, 12 Dec 2013 18:46:45 -0600 Subject: [PATCH] Update cache after ajax. Fixes #436 & #437 --- addons/pager/jquery.tablesorter.pager.js | 12 ++++++------ js/widgets/widget-pager.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index 47baf727..3ea18e5e 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -330,12 +330,12 @@ fixHeight(table, p); // apply widgets after table has rendered $t.trigger('applyWidgets'); - if (p.initialized) { - $t.trigger('pagerChange', p); - $t.trigger('updateComplete'); - } else { - $t.trigger('update'); - } + $t.trigger('update', [false, function(){ + if (p.initialized) { + $t.trigger('updateComplete'); + $t.trigger('pagerChange', p); + } + }]); } if (!p.initialized) { p.initialized = true; diff --git a/js/widgets/widget-pager.js b/js/widgets/widget-pager.js index 5a043566..58fa6a19 100644 --- a/js/widgets/widget-pager.js +++ b/js/widgets/widget-pager.js @@ -516,12 +516,12 @@ tsp = ts.pager = { tsp.fixHeight(table, c); // apply widgets after table has rendered $t.trigger('applyWidgets'); - if (p.initialized) { - $t.trigger('pagerChange', c); - $t.trigger('updateComplete'); - } else { - $t.trigger('update'); - } + $t.trigger('update', [false, function(){ + if (p.initialized) { + $t.trigger('updateComplete'); + $t.trigger('pagerChange', p); + } + }]); } if (!p.initialized) { p.initialized = true;