From e39a0b70692f89c83493371f141e82010f7c6e7c Mon Sep 17 00:00:00 2001 From: Katelyn Mann Date: Mon, 11 Apr 2016 15:31:11 -0700 Subject: [PATCH] Add event preventDefault() calls to the end of zoom button handlers so the browser doesn't try to handle them itself. This keeps it from selecting text on double clicks. --- core/workspace_svg.js | 1 + core/zoom_controls.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 311126e30..7d321ea72 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -1099,6 +1099,7 @@ Blockly.WorkspaceSvg.prototype.zoomReset = function(e) { } // This event has been handled. Don't start a workspace drag. e.stopPropagation(); + e.preventDefault(); }; /** diff --git a/core/zoom_controls.js b/core/zoom_controls.js index 31a0b2126..f745c9c21 100644 --- a/core/zoom_controls.js +++ b/core/zoom_controls.js @@ -166,10 +166,12 @@ Blockly.ZoomControls.prototype.createDom = function() { Blockly.bindEvent_(zoominSvg, 'mousedown', null, function(e) { workspace.zoomCenter(1); e.stopPropagation(); // Don't start a workspace scroll. + e.preventDefault(); }); Blockly.bindEvent_(zoomoutSvg, 'mousedown', null, function(e) { workspace.zoomCenter(-1); e.stopPropagation(); // Don't start a workspace scroll. + e.preventDefault(); }); return this.svgGroup_;