diff --git a/data/core.yaml b/data/core.yaml index e40b52190..a0842b3ee 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -19,6 +19,8 @@ en: tail: Click to add nodes to your area. Click the first node to finish the area. draw_line: tail: "Click to add more nodes to the line. Click on other lines to connect to them, and double-click to end the line." + drag_node: + connected_to_hidden: This can't be edited because it is connected to a hidden feature. operations: add: annotation: diff --git a/dist/locales/en.json b/dist/locales/en.json index 3606d5b92..29d3b87e6 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -25,6 +25,9 @@ }, "draw_line": { "tail": "Click to add more nodes to the line. Click on other lines to connect to them, and double-click to end the line." + }, + "drag_node": { + "connected_to_hidden": "This can't be edited because it is connected to a hidden feature." } }, "operations": { diff --git a/modules/modes/drag_node.js b/modules/modes/drag_node.js index 4e4fd22a5..baed024ae 100644 --- a/modules/modes/drag_node.js +++ b/modules/modes/drag_node.js @@ -28,6 +28,7 @@ import { import { geoChooseEdge } from '../geo'; import { osmNode } from '../osm'; import { utilEntitySelector } from '../util'; +import { uiFlash } from '../ui'; export function modeDragNode(context) { @@ -106,11 +107,14 @@ export function modeDragNode(context) { function start(entity) { wasMidpoint = entity.type === 'midpoint'; + var hasHidden = context.features().hasHiddenConnections(entity, context.graph()); + isCancelled = d3_event.sourceEvent.shiftKey || hasHidden; - isCancelled = d3_event.sourceEvent.shiftKey || - context.features().hasHiddenConnections(entity, context.graph()); if (isCancelled) { + if (hasHidden) { + uiFlash().text(t('modes.drag_node.connected_to_hidden'))(); + } return behavior.cancel(); }