Move registering objects to constructor (#3753)

This commit is contained in:
alschmiedt
2020-03-17 13:57:10 -07:00
committed by GitHub
parent 2d169eabd3
commit 7d5dcf6562

View File

@@ -105,6 +105,22 @@ Blockly.WorkspaceSvg = function(options,
*/
this.markerManager_ = new Blockly.MarkerManager(this);
/**
* Map from function names to callbacks, for deciding what to do when a custom
* toolbox category is opened.
* @type {!Object.<string, ?function(!Blockly.Workspace):!Array.<!Element>>}
* @private
*/
this.toolboxCategoryCallbacks_ = {};
/**
* Map from function names to callbacks, for deciding what to do when a button
* is clicked.
* @type {!Object.<string, ?function(!Blockly.FlyoutButton)>}
* @private
*/
this.flyoutButtonCallbacks_ = {};
if (Blockly.Variables && Blockly.Variables.flyoutCategory) {
this.registerToolboxCategoryCallback(Blockly.VARIABLE_CATEGORY_NAME,
Blockly.Variables.flyoutCategory);
@@ -374,22 +390,6 @@ Blockly.WorkspaceSvg.prototype.injectionDiv_ = null;
*/
Blockly.WorkspaceSvg.prototype.lastRecordedPageScroll_ = null;
/**
* Map from function names to callbacks, for deciding what to do when a button
* is clicked.
* @type {!Object.<string, ?function(!Blockly.FlyoutButton)>}
* @private
*/
Blockly.WorkspaceSvg.prototype.flyoutButtonCallbacks_ = {};
/**
* Map from function names to callbacks, for deciding what to do when a custom
* toolbox category is opened.
* @type {!Object.<string, ?function(!Blockly.Workspace):!Array.<!Element>>}
* @private
*/
Blockly.WorkspaceSvg.prototype.toolboxCategoryCallbacks_ = {};
/**
* Developers may define this function to add custom menu options to the
* workspace's context menu or edit the workspace-created set of menu options.