Merge "jquery.tablesorter: Only look at th's for headers"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 15 Aug 2014 13:32:49 +0000 (13:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 15 Aug 2014 13:32:49 +0000 (13:32 +0000)
1  2 
resources/src/jquery/jquery.tablesorter.js

                        colspan,
                        headerCount,
                        longestTR,
 -                      matrixRowIndex,
 -                      matrixColumnIndex,
                        exploded,
                        $tableHeaders = $( [] ),
                        $tableRows = $( 'thead:eq(0) > tr', table );
                        // Loop through all the dom cells of the thead
                        $tableRows.each( function ( rowIndex, row ) {
                                $.each( row.cells, function ( columnIndex, cell ) {
 +                                      var matrixRowIndex,
 +                                              matrixColumnIndex;
 +
                                        rowspan = Number( cell.rowSpan );
                                        colspan = Number( cell.colSpan );
  
                        } );
                        // We want to find the row that has the most columns (ignoring colspan)
                        $.each( exploded, function ( index, cellArray ) {
-                               headerCount = $.unique( $( cellArray ) ).length;
+                               headerCount = $( uniqueElements( cellArray ) ).filter( 'th' ).length;
                                if ( headerCount >= maxSeen ) {
                                        maxSeen = headerCount;
                                        longestTR = index;
                                }
                        } );
                        // We cannot use $.unique() here because it sorts into dom order, which is undesirable
-                       $tableHeaders = $( uniqueElements( exploded[longestTR] ) );
+                       $tableHeaders = $( uniqueElements( exploded[longestTR] ) ).filter( 'th' );
                }
  
                // as each header can span over multiple columns (using colspan=N),