mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 23:44:47 +02:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user