Core: while detecting parsers, use cssIngoreRow; stop after 50 rows

This commit is contained in:
Rob Garrison 2015-11-22 21:24:21 -06:00
parent a85a2a5a66
commit 06faff7764

View File

@ -735,14 +735,17 @@
}, },
detectParserForColumn : function( c, rows, rowIndex, cellIndex ) { detectParserForColumn : function( c, rows, rowIndex, cellIndex ) {
var cur, $node, var cur, $node, row,
indx = ts.parsers.length, indx = ts.parsers.length,
node = false, node = false,
nodeValue = '', nodeValue = '',
keepLooking = true; keepLooking = true;
while ( nodeValue === '' && keepLooking ) { while ( nodeValue === '' && keepLooking ) {
rowIndex++; rowIndex++;
if ( rows[ rowIndex ] ) { 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 ]; node = rows[ rowIndex ].cells[ cellIndex ];
nodeValue = ts.getElementText( c, node, cellIndex ); nodeValue = ts.getElementText( c, node, cellIndex );
$node = $( node ); $node = $( node );
@ -750,6 +753,7 @@
console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' + console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
cellIndex + ': "' + nodeValue + '"' ); cellIndex + ': "' + nodeValue + '"' );
} }
}
} else { } else {
keepLooking = false; keepLooking = false;
} }