From fbedbb1608b2cd1ea723c16295008683ae51357c Mon Sep 17 00:00:00 2001 From: Thomas Hervey Date: Fri, 20 Jul 2018 23:17:41 -0400 Subject: [PATCH] select note before rendering sidebar --- modules/behavior/hash.js | 2 -- modules/modes/drag_note.js | 4 ---- modules/modes/select_note.js | 5 +++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/behavior/hash.js b/modules/behavior/hash.js index cb073c40a..2aa76ff2b 100644 --- a/modules/behavior/hash.js +++ b/modules/behavior/hash.js @@ -51,8 +51,6 @@ export function behaviorHash(context) { var newParams = {}; delete q.id; - console.log('TAH - hash: context.selectedIDs()', context.selectedIDs()); - console.log('TAH - hash: context.selectedNoteID()', context.selectedNoteID()); var selected = context.selectedIDs().filter(function(id) { return !context.entity(id).isNew(); }); diff --git a/modules/modes/drag_note.js b/modules/modes/drag_note.js index d6d1f2b9b..602fac67e 100644 --- a/modules/modes/drag_note.js +++ b/modules/modes/drag_note.js @@ -111,8 +111,6 @@ export function modeDragNote(context) { function start(entity) { - console.log('TAH - drag_note start()'); - context.perform(actionNoop()); _activeEntity = entity; @@ -158,12 +156,10 @@ export function modeDragNote(context) { osm.replaceNote(entity); // update note cache } dispatch.call('change', this, 'difference'); - console.log('moved: ', entity.loc); } function end(entity) { - console.log('TAH - drag_note end()'); context .selectedNoteID(entity.id) .enter(modeSelectNote(context, entity.id)); diff --git a/modules/modes/select_note.js b/modules/modes/select_note.js index 56fe0f198..3692d4c13 100644 --- a/modules/modes/select_note.js +++ b/modules/modes/select_note.js @@ -80,6 +80,7 @@ export function modeSelectNote(context, selectedNoteID) { } else { selection .classed('selected', true); + context.selectedNoteID(selectedNoteID); } } @@ -100,13 +101,13 @@ export function modeSelectNote(context, selectedNoteID) { d3_select(document) .call(keybinding); + selectNote(); + context.ui().sidebar .show(noteEditor.note(note)); context.map() .on('drawn.select', selectNote); - - selectNote(); };