mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Use trim instead of all the other fixes, turns out double space was the issue
This commit is contained in:
parent
d248d6c8db
commit
7c7797eaf0
@ -8,7 +8,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var ts = $.tablesorter,
|
var ts = $.tablesorter,
|
||||||
events = ( 'tablesorter-initialized update updateAll updateRows addRows updateCell ' +
|
events = $.trim( 'tablesorter-initialized update updateAll updateRows addRows updateCell ' +
|
||||||
'filterReset filterEnd recalculate ' ).split(' ').join('.tsmath '),
|
'filterReset filterEnd recalculate ' ).split(' ').join('.tsmath '),
|
||||||
math = {
|
math = {
|
||||||
|
|
||||||
@ -389,26 +389,18 @@
|
|||||||
math_suffix : ''
|
math_suffix : ''
|
||||||
},
|
},
|
||||||
init : function(table, thisWidget, c, wo){
|
init : function(table, thisWidget, c, wo){
|
||||||
var init;
|
|
||||||
|
|
||||||
c.$table
|
c.$table
|
||||||
.off('update.tsmath init.tsmath')
|
.unbind(events + ' updateComplete.tsmath')
|
||||||
.on(events, function(e){
|
.bind(events, function(e){
|
||||||
init = e.type === 'tablesorter-initialized';
|
var init = e.type === 'tablesorter-initialized';
|
||||||
if (e.type === 'updateAll') {
|
if (e.type === 'updateAll') {
|
||||||
// redo data-column indexes in case columns were rearranged
|
// redo data-column indexes in case columns were rearranged
|
||||||
c.$table.trigger('update.tsmath');
|
ts.computeColumnIndex( c.$table.children('tbody').children() );
|
||||||
} else if (!wo.math_isUpdating || init) {
|
} else if (!wo.math_isUpdating || init) {
|
||||||
c.$table.trigger('init.tsmath');
|
math.recalculate( table, c, wo, init );
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('init.tsmath', function(){
|
.bind('updateComplete.tsmath', function(){
|
||||||
math.recalculate( table, c, wo, init );
|
|
||||||
})
|
|
||||||
.on('update.tsmath', function(){
|
|
||||||
ts.computeColumnIndex( c.$table.children('tbody').children() );
|
|
||||||
})
|
|
||||||
.on('updateComplete.tsmath', function(){
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
wo.math_isUpdating = false;
|
wo.math_isUpdating = false;
|
||||||
}, 500);
|
}, 500);
|
||||||
@ -420,7 +412,7 @@
|
|||||||
remove: function(table, c, wo, refreshing){
|
remove: function(table, c, wo, refreshing){
|
||||||
if (refreshing) { return; }
|
if (refreshing) { return; }
|
||||||
$(table)
|
$(table)
|
||||||
.unbind('update.tsmath init.tsmath updateComplete.tsmath')
|
.unbind(events + ' updateComplete.tsmath')
|
||||||
.find('[data-' + wo.math_data + ']').empty();
|
.find('[data-' + wo.math_data + ']').empty();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user