select note before rendering sidebar

This commit is contained in:
Thomas Hervey
2018-07-20 23:17:41 -04:00
parent 1d61355d08
commit fbedbb1608
3 changed files with 3 additions and 8 deletions
-2
View File
@@ -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();
});
-4
View File
@@ -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));
+3 -2
View File
@@ -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();
};