Core: add cssNoSort option

This commit is contained in:
Mottie 2015-02-17 14:49:23 -06:00
parent 764426d2c4
commit 39f50d90c9
2 changed files with 15 additions and 4 deletions

View File

@ -832,6 +832,14 @@
<td></td>
</tr>
<tr id="cssnosort">
<td><span class="permalink">cssNoSort</span></td>
<td>String</td>
<td>&quot;tablesorter-noSort&quot;</td>
<td>Class name added to element inside header. Clicking on that element won't cause a sort. (<span class="version">v2.19.2</span>).</td>
<td></td>
</tr>
<tr id="cssignorerow">
<td><a href="#" class="permalink">cssIgnoreRow</a></td>
<td>String</td>

View File

@ -105,6 +105,7 @@
cssIconDesc : '', // class name added to the icon when the column has a descending sort
cssInfoBlock : 'tablesorter-infoOnly', // don't sort tbody with this class name (only one class name allowed here!)
cssAllowClicks : 'tablesorter-allowClicks', // class name added to table header which allows clicks to bubble up
cssNoSort : 'tablesorter-noSort', // class name added to element inside header; clicking on it won't cause a sort
cssIgnoreRow : 'tablesorter-ignoreRow', // header row to ignore; cells within this row will not be added to c.$headers
// *** selectors
@ -1344,10 +1345,12 @@
// set timer on mousedown
if (type === 'mousedown') {
downTime = new Date().getTime();
cell = $.fn.closest ? $(e.target).closest('td,th') : $(e.target).parents('td,th').filter(':first');
return /(input|select|button|textarea)/i.test(e.target.tagName) ||
// allow clicks to contents of selected cells
cell.hasClass(c.cssAllowClicks) ? '' : !c.cancelSelection;
return;
}
cell = $.fn.closest ? $(e.target).closest('td,th') : $(e.target).parents('td,th').filter(':first');
// allow clicks to contents of selected cells
if ( /(input|select|button|textarea)/i.test(e.target.tagName) || ( cell.hasClass(c.cssAllowClicks) ) || $(e.target).hasClass(c.cssNoSort) ) {
return !c.cancelSelection;
}
if (c.delayInit && isEmptyObject(c.cache)) { buildCache(table); }
// jQuery v1.2.6 doesn't have closest()