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
20d87d933e
commit
44d90537cd
@ -962,12 +962,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