mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-23 16:49:40 +02:00
Fixes comments related to hover-highlighting
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user