mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Filter: defaultFilter now makes happy with spaces in the query. Fixes #704
This commit is contained in:
parent
b497cfb1a4
commit
6bec32a44b
@ -1006,12 +1006,12 @@ ts.filter = {
|
|||||||
defaultFilter: function(filter, mask){
|
defaultFilter: function(filter, mask){
|
||||||
if (filter === '') { return filter; }
|
if (filter === '') { return filter; }
|
||||||
var regex = ts.filter.regex.iQuery,
|
var regex = ts.filter.regex.iQuery,
|
||||||
maskRegex = ts.filter.regex.igQuery,
|
maskLen = mask.match( ts.filter.regex.igQuery ).length,
|
||||||
query = $.trim(filter).split(/\s/),
|
query = maskLen > 1 ? $.trim(filter).split(/\s/) : [ $.trim(filter) ],
|
||||||
len = query.length - 1,
|
len = query.length - 1,
|
||||||
indx = 0,
|
indx = 0,
|
||||||
val = mask;
|
val = mask;
|
||||||
if ( len < 1 && mask.match( maskRegex ).length > 1 ) {
|
if ( len < 1 && maskLen > 1 ) {
|
||||||
// only one "word" in query but mask has >1 slots
|
// only one "word" in query but mask has >1 slots
|
||||||
query[1] = query[0];
|
query[1] = query[0];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user