mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Merge pull request #4925 from gonfunko/copy-paste
Prevent an error beep when copying blocks in Safari.
This commit is contained in:
@@ -99,7 +99,10 @@ Blockly.ShortcutItems.registerCopy = function() {
|
|||||||
Blockly.selected.isDeletable() &&
|
Blockly.selected.isDeletable() &&
|
||||||
Blockly.selected.isMovable();
|
Blockly.selected.isMovable();
|
||||||
},
|
},
|
||||||
callback: function() {
|
callback: function(workspace, e) {
|
||||||
|
// Prevent the default copy behavior, which may beep or otherwise indicate
|
||||||
|
// an error due to the lack of a selection.
|
||||||
|
e.preventDefault();
|
||||||
Blockly.hideChaff();
|
Blockly.hideChaff();
|
||||||
Blockly.copy(/** @type {!Blockly.ICopyable} */ (Blockly.selected));
|
Blockly.copy(/** @type {!Blockly.ICopyable} */ (Blockly.selected));
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user