mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Filter: oops, keeping the faster getAttribute method
This commit is contained in:
parent
15284156d8
commit
5ad4509969
@ -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() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
js/jquery.tablesorter.widgets.min.js
vendored
2
js/jquery.tablesorter.widgets.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user