Ensure both notes and nodes can be dragged in selectNote mode

This commit is contained in:
Bryan Housel
2018-08-09 23:25:06 -04:00
parent ff9e60d205
commit f8f1c1f541
3 changed files with 12 additions and 7 deletions
+2 -1
View File
@@ -7,7 +7,8 @@
pointer-events: none;
}
.mode-browse .layer-notes .note .note-fill,
.mode-select .layer-notes .note .note-fill {
.mode-select .layer-notes .note .note-fill,
.mode-select-note .layer-notes .note .note-fill {
pointer-events: visible;
cursor: pointer; /* Opera */
cursor: url(img/cursor-select-point.png), pointer; /* FF */
+5 -5
View File
@@ -4,6 +4,7 @@ import {
} from 'd3-selection';
import { services } from '../services';
import { actionNoop } from '../actions';
import { behaviorEdit, behaviorDrag } from '../behavior';
import { geoVecSubtract, geoViewportEdge } from '../geo';
import { modeSelectNote } from './index';
@@ -47,7 +48,9 @@ export function modeDragNote(context) {
context.surface().selectAll('.note-' + note.id)
.classed('active', true);
context.perform(actionNoop());
context.enter(mode);
context.selectedNoteID(note.id);
}
@@ -79,15 +82,12 @@ export function modeDragNote(context) {
osm.replaceNote(note); // update note cache
}
// update note on screen (no need to do a full redraw)
context.surface().selectAll('.note-' + note.id)
.attr('transform', 'translate(' + currMouse[0] + ',' + currMouse[1] + ')');
context.replace(actionNoop()); // trigger redraw
}
function end(note) {
// force a reraw (there is no history change that would otherwise do this)
context.pan([0,0]);
context.replace(actionNoop()); // trigger redraw
context
.selectedNoteID(note.id)
+5 -1
View File
@@ -12,7 +12,10 @@ import {
behaviorSelect
} from '../behavior';
import { modeDragNote } from '../modes';
import {
modeDragNode,
modeDragNote
} from '../modes';
import { services } from '../services';
import { modeBrowse } from './browse';
@@ -41,6 +44,7 @@ export function modeSelectNote(context, selectedNoteID) {
behaviorHover(context),
behaviorSelect(context),
behaviorLasso(context),
modeDragNode(context).behavior,
modeDragNote(context).behavior
];