if ( node.tagName.toLowerCase() === 'img' ) {
return $node.attr( 'alt' ) || ''; // handle undefined alt
}
- return $.map( $.makeArray( node.childNodes ), function ( elem ) {
+ return $.makeArray( node.childNodes ).map( function ( elem ) {
if ( elem.nodeType === Node.ELEMENT_NODE ) {
return getElementSortKey( elem );
}
} );
} );
// We want to find the row that has the most columns (ignoring colspan)
- $.each( exploded, function ( index, cellArray ) {
+ exploded.forEach( function ( cellArray, index ) {
headerCount = $( uniqueElements( cellArray ) ).filter( 'th' ).length;
if ( headerCount >= maxSeen ) {
maxSeen = headerCount;
*/
function setHeadersOrder( $headers, sortList, headerToColumns ) {
// Loop through all headers to retrieve the indices of the columns the header spans across:
- $.each( headerToColumns, function ( headerIndex, columns ) {
+ headerToColumns.forEach( function ( columns, headerIndex ) {
- $.each( columns, function ( i, columnIndex ) {
+ columns.forEach( function ( columnIndex, i ) {
var header = $headers[ headerIndex ],
$header = $( header );
} );
} else {
// Column shall be sorted: Apply designated count and order.
- $.each( sortList, function ( j, sortColumn ) {
+ sortList.forEach( function ( sortColumn ) {
if ( sortColumn[ 0 ] === i ) {
$header.data( {
order: sortColumn[ 1 ],
}
return ret;
} );
- $.each( rowspanCells, function () {
- $.data( this, 'tablesorter' ).needResort = false;
+ rowspanCells.forEach( function ( cell ) {
+ $.data( cell, 'tablesorter' ).needResort = false;
} );
}
resortCells();