mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-04 18:33:38 +00:00
Display features in sidebar list only on search (#1629)
This commit is contained in:
@@ -187,7 +187,7 @@ en:
|
||||
search: Search
|
||||
unknown: Unknown
|
||||
incomplete: <not downloaded>
|
||||
feature_list: Feature list
|
||||
feature_list: Search features
|
||||
edit: Edit feature
|
||||
background:
|
||||
title: Background
|
||||
|
||||
2
dist/locales/en.json
vendored
2
dist/locales/en.json
vendored
@@ -230,7 +230,7 @@
|
||||
"search": "Search",
|
||||
"unknown": "Unknown",
|
||||
"incomplete": "<not downloaded>",
|
||||
"feature_list": "Feature list",
|
||||
"feature_list": "Search features",
|
||||
"edit": "Edit feature"
|
||||
},
|
||||
"background": {
|
||||
|
||||
@@ -50,21 +50,20 @@ iD.ui.FeatureList = function(context) {
|
||||
graph = context.graph(),
|
||||
q = search.property('value').toLowerCase();
|
||||
|
||||
if (!q) return result;
|
||||
|
||||
function addEntity(entity) {
|
||||
if (entity.id in entities || result.length > 200)
|
||||
return;
|
||||
|
||||
entities[entity.id] = true;
|
||||
|
||||
var preset = context.presets().match(entity, graph),
|
||||
name = iD.util.displayName(entity) || '';
|
||||
|
||||
if (!q || name.toLowerCase().indexOf(q) >= 0 ||
|
||||
preset.name().toLowerCase().indexOf(q) >= 0) {
|
||||
var name = iD.util.displayName(entity) || '';
|
||||
if (name.toLowerCase().indexOf(q) >= 0) {
|
||||
result.push({
|
||||
entity: entity,
|
||||
geometry: context.geometry(entity.id),
|
||||
preset: preset,
|
||||
preset: context.presets().match(entity, graph),
|
||||
name: name
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user