mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Fix search being canceled when filters emptied
Only reset the lastSearch and lastCombinedFilter variables if the filters were equal before. We don't need to "force filter refresh" if the filters were not equal anyways.
This commit is contained in:
parent
c2532c69a9
commit
20d87d933e
@ -1363,12 +1363,14 @@
|
|||||||
}
|
}
|
||||||
// return if the last search is the same; but filter === false when updating the search
|
// return if the last search is the same; but filter === false when updating the search
|
||||||
// see example-widget-filter.html filter toggle buttons
|
// see example-widget-filter.html filter toggle buttons
|
||||||
if ( tsf.equalFilters(c, c.lastSearch, currentFilters) && filter !== false ) {
|
if ( tsf.equalFilters(c, c.lastSearch, currentFilters) ) {
|
||||||
return;
|
if ( filter !== false ) {
|
||||||
} else if ( filter === false ) {
|
return;
|
||||||
// force filter refresh
|
} else {
|
||||||
c.lastCombinedFilter = '';
|
// force filter refresh
|
||||||
c.lastSearch = [];
|
c.lastCombinedFilter = '';
|
||||||
|
c.lastSearch = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// define filter inside it is false
|
// define filter inside it is false
|
||||||
filters = filters || [];
|
filters = filters || [];
|
||||||
|
Loading…
Reference in New Issue
Block a user