From ba59bdf23bf45c06f87111a3be92bee9c47a891e Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Mon, 23 Dec 2019 10:33:16 -0500 Subject: [PATCH] Disable operations, copy, and paste during low-zoom selection --- modules/behavior/copy.js | 3 +++ modules/behavior/operation.js | 3 +++ modules/behavior/paste.js | 3 +++ 3 files changed, 9 insertions(+) diff --git a/modules/behavior/copy.js b/modules/behavior/copy.js index 8cb5dbae7..05da18630 100644 --- a/modules/behavior/copy.js +++ b/modules/behavior/copy.js @@ -46,6 +46,9 @@ export function behaviorCopy(context) { function doCopy() { + // prevent copy during low zoom selection + if (!context.map().withinEditableZoom()) return; + if (!getSelectionText()) { d3_event.preventDefault(); } diff --git a/modules/behavior/operation.js b/modules/behavior/operation.js index 49afb121b..d71790e54 100644 --- a/modules/behavior/operation.js +++ b/modules/behavior/operation.js @@ -7,6 +7,9 @@ export function behaviorOperation(context) { var _operation; function keypress() { + // prevent operations during low zoom selection + if (!context.map().withinEditableZoom()) return; + d3_event.preventDefault(); var disabled = _operation.disabled(); var flash; diff --git a/modules/behavior/paste.js b/modules/behavior/paste.js index b103b4ab5..22d743c98 100644 --- a/modules/behavior/paste.js +++ b/modules/behavior/paste.js @@ -10,6 +10,9 @@ import { uiCmd } from '../ui/cmd'; export function behaviorPaste(context) { function doPaste() { + // prevent paste during low zoom selection + if (!context.map().withinEditableZoom()) return; + d3_event.preventDefault(); var baseGraph = context.graph();