Math: Add math ignore to cells. Closes #1526

This commit is contained in:
Rob Garrison 2019-12-01 06:38:14 -06:00
parent 7c6108bfa7
commit 755aa8a7e3
2 changed files with 9 additions and 8 deletions

View File

@ -198,6 +198,7 @@
<h3><a href="#">Notes</a></h3>
<div>
<ul>
<li>In <span class="version">v2.31.2</span>, added the missing ability to <a href="#attribute_settings" class="intlink">ignore cells</a>; which was already documented, but actually missing. See <a href="https://github.com/Mottie/tablesorter/issues/1526">issue #1526</a>.</li>
<li>In <span class="version">v2.31.1</span>, added <a href="#math_textattr" class="intlink"><code>math_textAttr</code></a>.</li>
<li>In <span class="version">v2.28.0</span>
<ul>

View File

@ -1,4 +1,4 @@
/*! Widget: math - updated 11/20/2018 (v2.31.1) *//*
/*! Widget: math - updated 12/1/2019 (v2.31.2) *//*
* Requires tablesorter v2.16+ and jQuery 1.7+
* by Rob Garrison
*/
@ -28,7 +28,7 @@
events : ( 'tablesorter-initialized update updateAll updateRows addRows updateCell filterReset ' )
.split(' ').join('.tsmath '),
processText : function( c, $cell ) {
processText : function( c, $cell ) {
var tmp,
wo = c.widgetOptions,
txt = ts.getElementText( c, $cell, math.getCellIndex( $cell ) ),
@ -110,7 +110,7 @@
// stop calculating 'above', when encountering another 'above'
if ( mathAbove ) {
index = 0;
} else if ( $t.length ) {
} else if ( $t.length && $t.not( mathIgnore ).length ) {
arry[ arry.length ] = math.processText( c, $t );
}
}
@ -132,7 +132,7 @@
});
if ( ( hasFilter || !$tr.hasClass( filtered ) ) &&
$tr.not( mathIgnore ).length &&
$t.length ) {
$t.length && $t.not( mathIgnore ) ) {
arry[ arry.length ] = math.processText( c, $t );
}
}
@ -149,11 +149,11 @@
});
if ( ( hasFilter || !$tr.hasClass( filtered ) ) &&
$t.not( mathAttrs.join( ',' ) ).length &&
!$t.is( $el ) ) {
arry[ arry.length ] = math.processText( c, $t );
!$t.is( $el ) && $t.not( mathIgnore ).length ) {
arry[ arry.length ] = math.processText( c, $t );
}
}
}
}
return arry;
},
@ -664,4 +664,4 @@
}
});
})(jQuery);
})(jQuery);