Put searchable and suggestions back in

Tests were not happy and I’m not going to dive into it right now.
Benchmarked it and it’s pretty quick, no big deal.
This commit is contained in:
Aaron Lidman
2013-11-22 12:58:49 -08:00
parent da7834ab7e
commit db5ad5223a
+8 -7
View File
@@ -1,13 +1,7 @@
iD.presets.Collection = function(collection) {
var maxSearchResults = 50,
maxSuggestionResults = 10,
searchable = _.filter(collection, function(a) {
return a.searchable !== false && a.suggestion !== true;
}),
suggestions = _.filter(collection, function(a) {
return a.suggestion === true;
});
maxSuggestionResults = 10;
var presets = {
@@ -30,6 +24,13 @@ iD.presets.Collection = function(collection) {
value = value.toLowerCase();
var searchable = _.filter(collection, function(a) {
return a.searchable !== false && a.suggestion !== true;
}),
suggestions = _.filter(collection, function(a) {
return a.suggestion === true;
});
// matches value to preset.name
var leading_name = _.filter(searchable, function(a) {
return leading(a.name().toLowerCase());