mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04: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:
parent
61b3fbfe11
commit
e39a0b7069
2 changed files with 3 additions and 0 deletions
|
@ -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_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue