Skip to content

Commit

Permalink
Make Remoteselect filter accept multiple words (as opposed to single …
Browse files Browse the repository at this point in the history
…ones)
  • Loading branch information
ivank committed Dec 6, 2013
1 parent 12fb72f commit 787e6cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion web/js/bootstrap-extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,13 @@ function ($) {
items;

items = $.grep(data, function (item) {
return ~item[that.options.display].toLowerCase().indexOf(that.query.toLowerCase());
var query_items = that.query.toLowerCase().split(' '),
data = item[that.options.display].toLowerCase();

for (var i = query_items.length - 1; i >= 0; i--) {
if (~data.indexOf(query_items[i]))
return true;
};
});

if (!items || !items.length) {
Expand Down
Loading

0 comments on commit 787e6cc

Please sign in to comment.