mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Core: while detecting parsers, use cssIngoreRow; stop after 50 rows
This commit is contained in:
parent
a85a2a5a66
commit
06faff7764
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user