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> <h3><a href="#">Notes</a></h3>
<div> <div>
<ul> <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.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> <li>In <span class="version">v2.28.0</span>
<ul> <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+ * Requires tablesorter v2.16+ and jQuery 1.7+
* by Rob Garrison * by Rob Garrison
*/ */
@ -110,7 +110,7 @@
// stop calculating 'above', when encountering another 'above' // stop calculating 'above', when encountering another 'above'
if ( mathAbove ) { if ( mathAbove ) {
index = 0; index = 0;
} else if ( $t.length ) { } else if ( $t.length && $t.not( mathIgnore ).length ) {
arry[ arry.length ] = math.processText( c, $t ); arry[ arry.length ] = math.processText( c, $t );
} }
} }
@ -132,7 +132,7 @@
}); });
if ( ( hasFilter || !$tr.hasClass( filtered ) ) && if ( ( hasFilter || !$tr.hasClass( filtered ) ) &&
$tr.not( mathIgnore ).length && $tr.not( mathIgnore ).length &&
$t.length ) { $t.length && $t.not( mathIgnore ) ) {
arry[ arry.length ] = math.processText( c, $t ); arry[ arry.length ] = math.processText( c, $t );
} }
} }
@ -149,7 +149,7 @@
}); });
if ( ( hasFilter || !$tr.hasClass( filtered ) ) && if ( ( hasFilter || !$tr.hasClass( filtered ) ) &&
$t.not( mathAttrs.join( ',' ) ).length && $t.not( mathAttrs.join( ',' ) ).length &&
!$t.is( $el ) ) { !$t.is( $el ) && $t.not( mathIgnore ).length ) {
arry[ arry.length ] = math.processText( c, $t ); arry[ arry.length ] = math.processText( c, $t );
} }
} }