chore: remove declareLegacyNamespace from events (#5532)

- Adds an extra events/utils.js file to hold helper methods related to events.
This commit is contained in:
alschmiedt
2021-09-24 14:20:32 -07:00
committed by GitHub
parent 16b6d4526a
commit 2b34748e0e
72 changed files with 1243 additions and 1126 deletions

View File

@@ -17,7 +17,6 @@ goog.module('Blockly.blockRendering.MarkerSvg');
const Connection = goog.requireType('Blockly.Connection');
/* eslint-disable-next-line no-unused-vars */
const ConstantProvider = goog.requireType('Blockly.blockRendering.ConstantProvider');
const Events = goog.require('Blockly.Events');
/* eslint-disable-next-line no-unused-vars */
const Field = goog.requireType('Blockly.Field');
/* eslint-disable-next-line no-unused-vars */
@@ -28,6 +27,7 @@ const Svg = goog.require('Blockly.utils.Svg');
/* eslint-disable-next-line no-unused-vars */
const WorkspaceSvg = goog.requireType('Blockly.WorkspaceSvg');
const dom = goog.require('Blockly.utils.dom');
const eventUtils = goog.require('Blockly.Events.utils');
const svgPaths = goog.require('Blockly.utils.svgPaths');
const {ASTNode} = goog.require('Blockly.ASTNode');
/* eslint-disable-next-line no-unused-vars */
@@ -557,9 +557,9 @@ MarkerSvg.prototype.hide = function() {
*/
MarkerSvg.prototype.fireMarkerEvent_ = function(oldNode, curNode) {
const curBlock = curNode.getSourceBlock();
const event = new (Events.get(Events.MARKER_MOVE))(
const event = new (eventUtils.get(eventUtils.MARKER_MOVE))(
curBlock, this.isCursor(), oldNode, curNode);
Events.fire(event);
eventUtils.fire(event);
};
/**