diff --git a/modules/modes/browse.js b/modules/modes/browse.js index 5552d91d6..16ed974d7 100644 --- a/modules/modes/browse.js +++ b/modules/modes/browse.js @@ -7,8 +7,6 @@ import { behaviorSelect } from '../behavior/index'; -import { modeDragNode } from './index'; - export function modeBrowse(context) { var mode = { @@ -22,8 +20,7 @@ export function modeBrowse(context) { behaviorPaste(context), behaviorHover(context).on('hover', context.ui().sidebar.hover), behaviorSelect(context), - behaviorLasso(context), - modeDragNode(context).behavior + behaviorLasso(context) ]; diff --git a/modules/modes/drag_node.js b/modules/modes/drag_node.js index 0eea5533b..391f9ab0a 100644 --- a/modules/modes/drag_node.js +++ b/modules/modes/drag_node.js @@ -79,12 +79,16 @@ export function modeDragNode(context) { function start(entity) { + activeIDs = _.map(context.graph().parentWays(entity), 'id'); + activeIDs.push(entity.id); + wasMidpoint = entity.type === 'midpoint'; + isCancelled = d3.event.sourceEvent.shiftKey || + !(wasMidpoint || _.some(activeIDs, function (activeID) { return selectedIDs.indexOf(activeID) !== -1; })) || context.features().hasHiddenConnections(entity, context.graph()); if (isCancelled) return behavior.cancel(); - wasMidpoint = entity.type === 'midpoint'; if (wasMidpoint) { var midpoint = entity; entity = osmNode(); @@ -97,8 +101,6 @@ export function modeDragNode(context) { context.perform(actionNoop()); } - activeIDs = _.map(context.graph().parentWays(entity), 'id'); - activeIDs.push(entity.id); context.enter(mode); }