Move clipboard functions to a separate namespace

This commit is contained in:
Rachel Fenichel
2021-07-28 11:57:24 -07:00
parent 2d9943e818
commit 961254663d
7 changed files with 129 additions and 57 deletions

View File

@@ -15,7 +15,7 @@
* @namespace
*/
goog.provide('Blockly.ContextMenuItems');
goog.require('Blockly.clipboard');
/** @suppress {extraRequire} */
goog.require('Blockly.constants');
goog.require('Blockly.ContextMenuRegistry');
@@ -316,7 +316,7 @@ Blockly.ContextMenuItems.registerDuplicate = function() {
},
callback: function(/** @type {!Blockly.ContextMenuRegistry.Scope} */ scope) {
if (scope.block) {
Blockly.duplicate(scope.block);
Blockly.clipboard.duplicate(scope.block);
}
},
scopeType: Blockly.ContextMenuRegistry.ScopeType.BLOCK,