From c7a1678d488e6165fb9072a8fefa37265dda2dde Mon Sep 17 00:00:00 2001 From: "Justin F. Hallett" Date: Mon, 9 Feb 2015 13:38:32 -0700 Subject: [PATCH] trim should include the join, update bindings to delegate bindings --- js/widgets/widget-math.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/widgets/widget-math.js b/js/widgets/widget-math.js index d3f57952..8ab87816 100644 --- a/js/widgets/widget-math.js +++ b/js/widgets/widget-math.js @@ -8,8 +8,8 @@ "use strict"; var ts = $.tablesorter, - events = $.trim( 'tablesorter-initialized update updateAll updateRows addRows updateCell ' + - 'filterReset filterEnd recalculate ' ).split(' ').join('.tsmath '), + events = $.trim( ( 'tablesorter-initialized update updateAll updateRows addRows updateCell ' + + 'filterReset filterEnd recalculate ' ).split(' ').join('.tsmath ') ), math = { // get all of the row numerical values in an arry @@ -390,8 +390,8 @@ }, init : function(table, thisWidget, c, wo){ c.$table - .unbind(events + ' updateComplete.tsmath') - .bind(events, function(e){ + .off(events + ' updateComplete.tsmath') + .on(events, function(e){ var init = e.type === 'tablesorter-initialized'; if (e.type === 'updateAll') { // redo data-column indexes in case columns were rearranged @@ -400,7 +400,7 @@ math.recalculate( table, c, wo, init ); } }) - .bind('updateComplete.tsmath', function(){ + .on('updateComplete.tsmath', function(){ setTimeout(function(){ wo.math_isUpdating = false; }, 500); @@ -412,7 +412,7 @@ remove: function(table, c, wo, refreshing){ if (refreshing) { return; } $(table) - .unbind(events + ' updateComplete.tsmath') + .off(events + ' updateComplete.tsmath') .find('[data-' + wo.math_data + ']').empty(); } });