Merge pull request #5402 from quincylvania/relation-member-hover-highlighting

Adds highlighting of relation members in the map when hovering on their list item
This commit is contained in:
Bryan Housel
2018-10-14 13:47:28 -04:00
committed by GitHub
2 changed files with 23 additions and 1 deletions
+12
View File
@@ -265,6 +265,18 @@ text.point {
opacity: 0.8;
}
/* Highlighting */
g.point.highlighted .shadow,
path.shadow.highlighted {
stroke-opacity: 0.95;
stroke: #7092ff;
}
g.vertex.highlighted .shadow {
stroke-width: 7;
stroke-opacity: 0.95;
stroke: #7092ff;
}
/* Turn Restrictions */
+11 -1
View File
@@ -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('highlighted', true);
});
d3_select(this).on('mouseout', function() {
context.surface().selectAll(selectorPrefix+d.id).classed('highlighted', 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 }));