Skip to content

Commit

Permalink
Core: while detecting parsers, use cssIngoreRow; stop after 50 rows
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Nov 23, 2015
1 parent a85a2a5 commit 06faff7
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions js/jquery.tablesorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,20 +735,24 @@
},

detectParserForColumn : function( c, rows, rowIndex, cellIndex ) {
var cur, $node,
var cur, $node, row,
indx = ts.parsers.length,
node = false,
nodeValue = '',
keepLooking = true;
while ( nodeValue === '' && keepLooking ) {
rowIndex++;
if ( rows[ rowIndex ] ) {
node = rows[ rowIndex ].cells[ cellIndex ];
nodeValue = ts.getElementText( c, node, cellIndex );
$node = $( node );
if ( c.debug ) {
console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
cellIndex + ': "' + nodeValue + '"' );
row = rows[ rowIndex ];
// stop looking after 50 empty rows
if ( row && rowIndex < 50 ) {
if ( row.className.indexOf( ts.cssIgnoreRow ) < 0 ) {
node = rows[ rowIndex ].cells[ cellIndex ];
nodeValue = ts.getElementText( c, node, cellIndex );
$node = $( node );
if ( c.debug ) {
console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
cellIndex + ': "' + nodeValue + '"' );
}
}
} else {
keepLooking = false;
Expand Down

0 comments on commit 06faff7

Please sign in to comment.