Don't use double point icons

Remove subsections when reloading
This commit is contained in:
Quincy Morgan
2019-03-04 10:28:13 -05:00
parent 9f3329149c
commit 7bf73111c4
2 changed files with 20 additions and 13 deletions

View File

@@ -23,6 +23,8 @@ export function uiPresetIcon() {
return 'iD-other-line';
else if (geom === 'vertex')
return p.isFallback() ? '' : 'temaki-vertex';
else if (isSmall() && geom === 'point')
return null;
else
return 'maki-marker-stroked';
}
@@ -148,9 +150,9 @@ export function uiPresetIcon() {
var p = preset.apply(this, arguments);
var geom = geometry ? geometry.apply(this, arguments) : null;
var picon = getIcon(p, geom);
var isMaki = /^maki-/.test(picon);
var isTemaki = /^temaki-/.test(picon);
var isFa = /^fa[srb]-/.test(picon);
var isMaki = picon ? /^maki-/.test(picon) : false;
var isTemaki = picon ? /^temaki-/.test(picon) : false;
var isFa = picon ? /^fa[srb]-/.test(picon) : false;
var isiDIcon = !(isMaki || isTemaki || isFa);
var isCategory = !p.setTags;
var drawLine = geom === 'line' && !isCategory;
@@ -229,18 +231,22 @@ export function uiPresetIcon() {
.call(svgIcon(''))
.merge(icon);
icon
.attr('class', 'preset-icon ' + (geom ? geom + '-geom' : ''))
.classed('framed', isFramed)
.classed('preset-icon-iD', isiDIcon);
if (picon) {
icon.selectAll('svg')
.attr('class', function() {
return 'icon ' + picon + ' ' + (!isiDIcon && geom !== 'line' ? '' : tagClasses);
});
icon
.attr('class', 'preset-icon ' + (geom ? geom + '-geom' : ''))
.classed('framed', isFramed)
.classed('preset-icon-iD', isiDIcon);
icon.selectAll('svg')
.attr('class', function() {
return 'icon ' + picon + ' ' + (!isiDIcon && geom !== 'line' ? '' : tagClasses);
});
icon.selectAll('use')
.attr('href', '#' + picon + (isMaki ? (isSmall() && geom === 'point' ? '-11' : '-15') : ''));
}
icon.selectAll('use')
.attr('href', '#' + picon + (isMaki ? (isSmall() && geom === 'point' ? '-11' : '-15') : ''));
}

View File

@@ -119,6 +119,7 @@ export function uiSearchAdd(context) {
var value = search.property('value');
//list.classed('filtered', value.length);
if (value.length) {
popover.selectAll('.subsection').remove();
var results = presets.search(value);
list.call(drawList, results);
popover.selectAll('.list .list-item.focused')