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:
Katelyn Mann 2016-04-11 15:31:11 -07:00
parent 61b3fbfe11
commit e39a0b7069
2 changed files with 3 additions and 0 deletions

View file

@ -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();
};
/**

View file

@ -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_;