Filter: defaultFilter now makes happy with spaces in the query. Fixes #704

This commit is contained in:
Mottie 2014-08-28 11:45:26 -05:00
parent b497cfb1a4
commit 6bec32a44b

View File

@ -1006,12 +1006,12 @@ ts.filter = {
defaultFilter: function(filter, mask){
if (filter === '') { return filter; }
var regex = ts.filter.regex.iQuery,
maskRegex = ts.filter.regex.igQuery,
query = $.trim(filter).split(/\s/),
maskLen = mask.match( ts.filter.regex.igQuery ).length,
query = maskLen > 1 ? $.trim(filter).split(/\s/) : [ $.trim(filter) ],
len = query.length - 1,
indx = 0,
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
query[1] = query[0];
}