Allow all nodes and vertices to be dragged

(revert of #3739)
This commit is contained in:
Bryan Housel
2017-04-25 16:04:15 -04:00
parent 3b54743f86
commit e6da524f82
2 changed files with 6 additions and 16 deletions
+5 -2
View File
@@ -5,7 +5,9 @@ import {
behaviorLasso,
behaviorPaste,
behaviorSelect
} from '../behavior/index';
} from '../behavior';
import { modeDragNode } from './drag_node';
export function modeBrowse(context) {
@@ -20,7 +22,8 @@ export function modeBrowse(context) {
behaviorPaste(context),
behaviorHover(context).on('hover', context.ui().sidebar.hover),
behaviorSelect(context),
behaviorLasso(context)
behaviorLasso(context),
modeDragNode(context).behavior
];
+1 -14
View File
@@ -101,20 +101,7 @@ export function modeDragNode(context) {
function start(entity) {
wasMidpoint = entity.type === 'midpoint';
// Things allowed to be dragged include:
// - midpoints
// - nodes that are selected
// - vertices that are selected
// - vertices classed 'sibling' which includes (see svg/vertices.js)
// - children of selected ways or multipolygons
// - vertices sharing a way with selected vertices
var selector = 'g.node.point.selected.' + entity.id +
', g.vertex-persistent.selected.' + entity.id +
', g.vertex-persistent.sibling.' + entity.id;
var isDraggable = wasMidpoint || !d3.select(selector).empty();
isCancelled = d3.event.sourceEvent.shiftKey || !isDraggable ||
isCancelled = d3.event.sourceEvent.shiftKey ||
context.features().hasHiddenConnections(entity, context.graph());
if (isCancelled) {