mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-31 17:20:30 +02:00
Adds highlighting of relation members in the map when hovering on their list item
This commit is contained in:
@@ -122,6 +122,16 @@ export function uiRawMemberEditor(context) {
|
||||
enter
|
||||
.each(function(d) {
|
||||
if (d.member) {
|
||||
|
||||
// highlight the member feature in the map while hovering on the list item
|
||||
var selectorPrefix = d.type === 'node' ? 'g.' : 'path.';
|
||||
d3_select(this).on('mouseover', function() {
|
||||
context.surface().selectAll(selectorPrefix+d.id).classed('related', true);
|
||||
});
|
||||
d3_select(this).on('mouseout', function() {
|
||||
context.surface().selectAll(selectorPrefix+d.id).classed('related', false);
|
||||
});
|
||||
|
||||
var label = d3_select(this).append('label')
|
||||
.attr('class', 'form-label')
|
||||
.append('a')
|
||||
@@ -142,7 +152,7 @@ export function uiRawMemberEditor(context) {
|
||||
} else {
|
||||
var incompleteLabel = d3_select(this).append('label')
|
||||
.attr('class', 'form-label');
|
||||
|
||||
|
||||
incompleteLabel.append('span')
|
||||
.attr('class', 'member-entity-type')
|
||||
.text(t('inspector.'+d.type, { id: d.id }));
|
||||
|
||||
Reference in New Issue
Block a user