mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
Always show generic presets when searching
This commit is contained in:
@@ -152,8 +152,13 @@ export function presetCollection(collection) {
|
||||
).slice(0, maxSearchResults - 1);
|
||||
|
||||
if (geometry) {
|
||||
var other = presets.item(geometry);
|
||||
results = results.concat(other);
|
||||
if (typeof geometry === 'string') {
|
||||
results.push(presets.item(geometry));
|
||||
} else {
|
||||
geometry.forEach(function(geom) {
|
||||
results.push(presets.item(geom));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return presetCollection(_uniq(results));
|
||||
|
||||
@@ -25,7 +25,7 @@ export function uiSearchAdd(context) {
|
||||
var presets;
|
||||
var search = d3_select(null), popover = d3_select(null), list = d3_select(null);
|
||||
|
||||
var shownGeometry = ['vertex', 'point', 'line', 'area'];
|
||||
var shownGeometry = ['area', 'line', 'point', 'vertex'];
|
||||
|
||||
function searchAdd(selection) {
|
||||
|
||||
@@ -133,7 +133,7 @@ export function uiSearchAdd(context) {
|
||||
var value = search.property('value');
|
||||
if (value.length) {
|
||||
popover.selectAll('.subsection').remove();
|
||||
var results = presets.search(value);
|
||||
var results = presets.search(value, shownGeometry);
|
||||
list.call(drawList, results);
|
||||
popover.selectAll('.list .list-item.focused')
|
||||
.classed('focused', false);
|
||||
|
||||
Reference in New Issue
Block a user