mirror of
https://github.com/google/blockly.git
synced 2026-01-11 10:57:07 +01:00
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.
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user