mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-10-08 13:44:18 +00:00
Math: ensure internal updating flag gets cleared. Fixes #1083
This commit is contained in:
parent
06faff7764
commit
a8d9c2bbbe
2
dist/js/widgets/widget-math.min.js
vendored
2
dist/js/widgets/widget-math.min.js
vendored
File diff suppressed because one or more lines are too long
@ -180,7 +180,7 @@
|
|||||||
recalculate : function(c, wo, init) {
|
recalculate : function(c, wo, init) {
|
||||||
if ( c && ( !wo.math_isUpdating || init ) ) {
|
if ( c && ( !wo.math_isUpdating || init ) ) {
|
||||||
|
|
||||||
var time, mathAttr, $mathCells;
|
var undef, time, mathAttr, $mathCells;
|
||||||
if ( c.debug ) {
|
if ( c.debug ) {
|
||||||
time = new Date();
|
time = new Date();
|
||||||
}
|
}
|
||||||
@ -215,7 +215,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// update internal cache
|
// update internal cache
|
||||||
ts.update( c );
|
ts.update( c, undef, function(){
|
||||||
|
math.updateComplete( c );
|
||||||
|
});
|
||||||
|
|
||||||
if ( c.debug ) {
|
if ( c.debug ) {
|
||||||
console.log( 'Math widget update completed' + ts.benchmark( time ) );
|
console.log( 'Math widget update completed' + ts.benchmark( time ) );
|
||||||
@ -223,6 +225,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updateComplete : function( c ) {
|
||||||
|
var wo = c.widgetOptions;
|
||||||
|
if ( wo.math_isUpdating && c.debug && console.groupEnd ) { console.groupEnd(); }
|
||||||
|
wo.math_isUpdating = false;
|
||||||
|
},
|
||||||
|
|
||||||
mathType : function( c, $cells, priority ) {
|
mathType : function( c, $cells, priority ) {
|
||||||
if ( $cells.length ) {
|
if ( $cells.length ) {
|
||||||
var formula, result, $el, arry, getAll, $targetCells, index, len,
|
var formula, result, $el, arry, getAll, $targetCells, index, len,
|
||||||
@ -532,8 +540,7 @@
|
|||||||
})
|
})
|
||||||
.on( update + '.tsmath', function() {
|
.on( update + '.tsmath', function() {
|
||||||
setTimeout( function(){
|
setTimeout( function(){
|
||||||
if ( wo.math_isUpdating && c.debug && console.groupEnd ) { console.groupEnd(); }
|
math.updateComplete( c );
|
||||||
wo.math_isUpdating = false;
|
|
||||||
}, 40 );
|
}, 40 );
|
||||||
});
|
});
|
||||||
wo.math_isUpdating = false;
|
wo.math_isUpdating = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user