Math: ensure internal updating flag gets cleared. Fixes #1083

This commit is contained in:
Rob Garrison 2015-11-22 21:44:10 -06:00
parent 06faff7764
commit a8d9c2bbbe
2 changed files with 12 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -180,7 +180,7 @@
recalculate : function(c, wo, init) {
if ( c && ( !wo.math_isUpdating || init ) ) {
var time, mathAttr, $mathCells;
var undef, time, mathAttr, $mathCells;
if ( c.debug ) {
time = new Date();
}
@ -215,7 +215,9 @@
}
// update internal cache
ts.update( c );
ts.update( c, undef, function(){
math.updateComplete( c );
});
if ( c.debug ) {
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 ) {
if ( $cells.length ) {
var formula, result, $el, arry, getAll, $targetCells, index, len,
@ -532,8 +540,7 @@
})
.on( update + '.tsmath', function() {
setTimeout( function(){
if ( wo.math_isUpdating && c.debug && console.groupEnd ) { console.groupEnd(); }
wo.math_isUpdating = false;
math.updateComplete( c );
}, 40 );
});
wo.math_isUpdating = false;