From 36a8b5a28eb48156f44a116f188b9357f6ac3835 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sun, 13 Dec 2015 09:23:49 -0600 Subject: [PATCH] Math: fix changed flag to not break calculations. See #1083 --- js/widgets/widget-math.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/widgets/widget-math.js b/js/widgets/widget-math.js index 3b1fadbf..984aaec6 100644 --- a/js/widgets/widget-math.js +++ b/js/widgets/widget-math.js @@ -236,7 +236,7 @@ // all non-info tbody cells mathAttr = wo.math_dataAttrib; $mathCells = c.$tbodies.children( 'tr' ).children( '[' + mathAttr + ']' ); - changed = changed || math.mathType( c, $mathCells, wo.math_priority ); + changed = math.mathType( c, $mathCells, wo.math_priority ) || changed; // only info tbody cells $mathCells = c.$table @@ -256,7 +256,7 @@ filters[ filter ] = filters[ filter ] ? filters[ filter ].add( $cell ) : $cell; }); $.each( filters, function( hasFilter, $cells ) { - changed = changed || math.mathType( c, $cells, [ 'all' ], hasFilter ); + changed = math.mathType( c, $cells, [ 'all' ], hasFilter ) || changed; }); // trigger an update only if cells inside the tbody changed