Filter: oops, keeping the faster getAttribute method

This commit is contained in:
Mottie 2015-02-12 10:14:49 -06:00
parent 15284156d8
commit 5ad4509969
2 changed files with 6 additions and 7 deletions

View File

@ -1260,12 +1260,11 @@ ts.filter = {
data.anyMatch = true;
data.rowArray = $cells.map(function(i){
if ( $.inArray(i, columnIndex) > -1 ) {
var txt, $this;
var txt;
if (data.parsed[i]) {
txt = data.cacheArray[i];
} else {
$this = $(this);
txt = $this.length ? $this.attr( c.textAttribute ) || this.textContent || $this.text() : '';
txt = this ? this.getAttribute( c.textAttribute ) || this.textContent || $(this).text() : '';
txt = $.trim( wo.filter_ignoreCase ? txt.toLowerCase() : txt );
if (c.sortLocaleCompare) {
txt = ts.replaceAccents(txt);
@ -1320,8 +1319,8 @@ ts.filter = {
if (wo.filter_useParsedData || data.parsed[columnIndex]) {
data.exact = data.cache;
} else {
val = $cells.eq(columnIndex);
result = val.length ? $.trim( val.attr( c.textAttribute ) || val[0].textContent || val.text() ) : '';
val = $cells[columnIndex];
result = val ? $.trim( val.getAttribute( c.textAttribute ) || val.textContent || $cells.eq(columnIndex).text() ) : '';
data.exact = c.sortLocaleCompare ? ts.replaceAccents(result) : result; // issue #405
}
data.iExact = !regex.type.test(typeof data.exact) && wo.filter_ignoreCase ? data.exact.toLocaleLowerCase() : data.exact;
@ -1507,7 +1506,7 @@ ts.filter = {
} else {
cell = row.cells[column];
if (cell) {
arry.push( $.trim( $(cell).attr( c.textAttribute ) || cell.textContent || $(cell).text() ) );
arry.push( $.trim( cell.getAttribute( c.textAttribute ) || cell.textContent || $(cell).text() ) );
}
}
}

File diff suppressed because one or more lines are too long