mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 21:28:11 +02:00
Ensure both notes and nodes can be dragged in selectNote mode
This commit is contained in:
+2
-1
@@ -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 */
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user