Skip to content

Commit

Permalink
Merge pull request #3994 from ShawnCholeva/ShawnCholeva-dropdown-exac…
Browse files Browse the repository at this point in the history
…t-search

[Dropdown] Add exact search - #3085
  • Loading branch information
jlukic committed May 15, 2016
2 parents 8755da7 + 3e6a37f commit cd63885
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,11 @@ $.fn.dropdown = function(parameters) {
results.push(this);
return true;
}
else if(settings.fullTextSearch && module.fuzzySearch(searchTerm, text)) {
else if (settings.fullTextSearch === "exact" && module.exactSearch(searchTerm, text)) {
results.push(this);
return true;
}
else if (!settings.fullTextSearch === "exact" && settings.fullTextSearch && module.fuzzySearch(searchTerm, text)) {
results.push(this);
return true;
}
Expand Down Expand Up @@ -835,7 +839,15 @@ $.fn.dropdown = function(parameters) {
}
return true;
},
exactSearch: function (query, term) {
query = query.toLowerCase();
term = term.toLowerCase();

if (term.indexOf(query) > -1) {
return true;
}
return false;
},
filterActive: function() {
if(settings.useLabels) {
$item.filter('.' + className.active)
Expand Down

0 comments on commit cd63885

Please sign in to comment.