From bd8705bf85a678e63f9ddb1d1c5144844aeedfea Mon Sep 17 00:00:00 2001 From: Thomas Hervey Date: Mon, 2 Jul 2018 16:32:17 -0400 Subject: [PATCH] updated: reintroduced hovering on notes --- modules/ui/sidebar.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/ui/sidebar.js b/modules/ui/sidebar.js index ad3d1e155..509d2c1c6 100644 --- a/modules/ui/sidebar.js +++ b/modules/ui/sidebar.js @@ -1,5 +1,7 @@ import _throttle from 'lodash-es/throttle'; +import { selectAll as d3_selectAll } from 'd3-selection'; + import { osmNote } from '../osm'; import { uiFeatureList } from './feature_list'; import { uiInspector } from './inspector'; @@ -11,6 +13,7 @@ export function uiSidebar(context) { var noteEditor = uiNoteEditor(context); var _current; var _wasNote = false; + // var layer = d3_select(null); function sidebar(selection) { @@ -28,6 +31,9 @@ export function uiSidebar(context) { function hover(what) { if ((what instanceof osmNote)) { _wasNote = true; + var notes = d3_selectAll('.note'); + notes + .classed('hovered', function(d) { return d === what; }); context.ui().sidebar.show(noteEditor.note(what)); } else if (!_current && context.hasEntity(what)) { @@ -57,6 +63,8 @@ export function uiSidebar(context) { } else if (_wasNote) { _wasNote = false; + d3_selectAll('.note') + .classed('hovered', false); context.ui().sidebar.hide(); } }