refactor: move Blockly.deleteBlock out of blockly.js (#5483)

This commit is contained in:
Maribeth Bottorff
2021-09-16 15:13:59 -07:00
committed by GitHub
parent c5acc1de72
commit 3bac582edb
6 changed files with 36 additions and 33 deletions

View File

@@ -13,7 +13,6 @@
goog.module('Blockly.ContextMenuItems');
goog.module.declareLegacyNamespace();
const Blockly = goog.require('Blockly');
/* eslint-disable-next-line no-unused-vars */
const BlockSvg = goog.requireType('Blockly.BlockSvg');
const ContextMenuRegistry = goog.require('Blockly.ContextMenuRegistry');
@@ -530,11 +529,9 @@ const registerDelete = function() {
},
callback: function(/** @type {!ContextMenuRegistry.Scope} */
scope) {
Events.setGroup(true);
if (scope.block) {
Blockly.deleteBlock(scope.block);
scope.block.checkAndDelete();
}
Events.setGroup(false);
},
scopeType: ContextMenuRegistry.ScopeType.BLOCK,
id: 'blockDelete',