Skip to content

Commit

Permalink
Core: Allow passing headers from multiple rows. See Mottie#1116
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Apr 12, 2018
1 parent 2983454 commit 200fcac
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions js/jquery.tablesorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,8 @@
ts.buildCache( c );
}
$cell = ts.getClosest( $( this ), '.' + ts.css.header );
// reference original table headers and find the same cell
// don't use $headers or IE8 throws an error - see #987
temp = $headers.index( $cell );
c.last.clickedIndex = ( temp < 0 ) ? $cell.attr( 'data-column' ) : temp;
// use column index if $headers is undefined
// use column index from data-attribute or index of current row; fixes #1116
c.last.clickedIndex = $cell.attr( 'data-column' ) || $cell.index();
cell = c.$headers[ c.last.clickedIndex ];
if ( cell && !cell.sortDisabled ) {
ts.initSort( c, cell, e );
Expand Down

0 comments on commit 200fcac

Please sign in to comment.