From 213747fc6b22edad695607d6d7fd15abdbdbe966 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Mon, 28 May 2018 15:15:07 -0500 Subject: [PATCH] Core: Ignore clicks on disabled colspan headers. Fixes #1550 Changes related to #1524 --- js/jquery.tablesorter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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];