diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 293d8b57..e17afe2d 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -506,10 +506,13 @@ return; } downTarget = null; + $cell = ts.getClosest( $( this ), '.' + ts.css.header ); // prevent sort being triggered on form elements if ( ts.regex.formElements.test( e.target.nodeName ) || // nosort class name, or elements within a nosort container $target.hasClass( c.cssNoSort ) || $target.parents( '.' + c.cssNoSort ).length > 0 || + // disabled cell directly clicked + $cell.hasClass( 'sorter-false' ) || // elements within a button $target.parents( 'button' ).length > 0 ) { return !c.cancelSelection; @@ -517,7 +520,6 @@ if ( c.delayInit && ts.isEmptyObject( c.cache ) ) { ts.buildCache( c ); } - $cell = ts.getClosest( $( this ), '.' + ts.css.header ); // use column index from data-attribute or index of current row; fixes #1116 c.last.clickedIndex = $cell.attr( 'data-column' ) || $cell.index(); cell = c.$headerIndexed[ c.last.clickedIndex ][0];