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,20 +735,24 @@
}, },
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 ];
node = rows[ rowIndex ].cells[ cellIndex ]; // stop looking after 50 empty rows
nodeValue = ts.getElementText( c, node, cellIndex ); if ( row && rowIndex < 50 ) {
$node = $( node ); if ( row.className.indexOf( ts.cssIgnoreRow ) < 0 ) {
if ( c.debug ) { node = rows[ rowIndex ].cells[ cellIndex ];
console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' + nodeValue = ts.getElementText( c, node, cellIndex );
cellIndex + ': "' + nodeValue + '"' ); $node = $( node );
if ( c.debug ) {
console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
cellIndex + ': "' + nodeValue + '"' );
}
} }
} else { } else {
keepLooking = false; keepLooking = false;