diff --git a/modules/ui/entity_highlight.js b/modules/ui/entity_highlight.js index a9f222c1c..cc92a0250 100644 --- a/modules/ui/entity_highlight.js +++ b/modules/ui/entity_highlight.js @@ -2,8 +2,8 @@ import _forEach from 'lodash-es/forEach'; export function highlightEntity(context, entity, highlighted) { - // highlight the member feature in the map while hovering on the list item var selectorPrefix = entity.type === 'node' ? 'g.' : 'path.'; + // set the class for the SVG to add or remove the highlighted styling context.surface().selectAll(selectorPrefix+entity.id).classed('highlighted', highlighted); if (entity.members) { // recursively highlight members so that relations will appear highlighted diff --git a/modules/ui/raw_member_editor.js b/modules/ui/raw_member_editor.js index bf820776a..a2a70be89 100644 --- a/modules/ui/raw_member_editor.js +++ b/modules/ui/raw_member_editor.js @@ -134,6 +134,7 @@ export function uiRawMemberEditor(context) { .each(function(d) { if (d.member) { + // highlight the member feature in the map while hovering on the list item d3_select(this).on('mouseover', function() { highlightEntity(context, d.member, true); }); diff --git a/modules/ui/raw_membership_editor.js b/modules/ui/raw_membership_editor.js index 1c71eeb2c..a63c9e668 100644 --- a/modules/ui/raw_membership_editor.js +++ b/modules/ui/raw_membership_editor.js @@ -175,6 +175,7 @@ export function uiRawMembershipEditor(context) { .attr('class', 'member-row member-row-normal form-field'); enter.each(function(d){ + // highlight the relation in the map while hovering on the list item d3_select(this).on('mouseover', function() { highlightEntity(context, d.relation, true); });