From eb3c1f07ec72428eed8b0d01ebf61c99a1355ead Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 20 Feb 2018 09:10:17 -0500 Subject: [PATCH] Always restyle a selected from way (don't reset it to grey) --- modules/ui/fields/restrictions.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/ui/fields/restrictions.js b/modules/ui/fields/restrictions.js index 1044b72a7..bfe00e777 100644 --- a/modules/ui/fields/restrictions.js +++ b/modules/ui/fields/restrictions.js @@ -410,7 +410,7 @@ export function uiFieldRestrictions(field, context) { function updateHelp(datum) { var help = _container.selectAll('.restriction-help').html(''); - var div, d, turnType, r; + var div, d, turnType, way, r; var entity = datum && datum.properties && datum.properties.entity; if (entity) { @@ -423,6 +423,16 @@ export function uiFieldRestrictions(field, context) { .classed('restrict', false) .classed('only', false); + if (_fromWayID) { + way = vgraph.entity(_fromWayID); + surface + .selectAll('.' + _fromWayID) + .classed('selected', true) + .classed('related', true) + .classed('only', !!way.__fromOnly); + } + + if (datum instanceof osmWay) { surface.selectAll('.' + datum.id) @@ -508,13 +518,6 @@ export function uiFieldRestrictions(field, context) { } else { // datum is empty surface if (_fromWayID) { - var way = vgraph.entity(_fromWayID); - surface - .selectAll('.' + _fromWayID) - .classed('selected', true) - .classed('related', true) - .classed('only', !!way.__fromOnly); - if (way.__fromOnly) { r = vgraph.entity(way.__fromOnly); @@ -533,6 +536,7 @@ export function uiFieldRestrictions(field, context) { div = help.append('div'); div.append('span').attr('class', 'qualifier').text('FROM'); div.append('span').text(d.name || d.type); + } else { div = help.append('div'); div.append('span').text('Click to select the');