mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
fix: custom block context menus (#5976)
* fix: custom block context menus * fix: move rendered-specific properties back into BlockSvg
This commit is contained in:
@@ -162,31 +162,6 @@ class Block {
|
||||
*/
|
||||
this.loadExtraState = undefined;
|
||||
|
||||
/**
|
||||
* An optional method called by the default mutator UI which allows the
|
||||
* block to "explode" itself into smaller sub blocks. This function should
|
||||
* return a "top block" which is the main block in the mutator workspace
|
||||
* that sub-blocks connect to.
|
||||
* @type {undefined|?function():!Block}
|
||||
*/
|
||||
this.decompose = undefined;
|
||||
|
||||
/**
|
||||
* An optional method called by the deafult mutator UI which allows the
|
||||
* block to configure itself based on the configuration of sub-blocks in
|
||||
* the mutator workspace. This function should accept the "top block" which
|
||||
* was returned by `decompose` as a paramter.
|
||||
* @type {undefined|?function(!Block)}
|
||||
*/
|
||||
this.compose = undefined;
|
||||
|
||||
/**
|
||||
* An optional method called by the default mutator UI which gives the block
|
||||
* a chance to save information about what child blocks are connected to
|
||||
* what mutated connections.
|
||||
* @type {undefined|?function(!Block)}
|
||||
*/
|
||||
this.saveConnections = undefined;
|
||||
|
||||
/**
|
||||
* An optional property for suppressing adding STATEMENT_PREFIX and
|
||||
|
||||
@@ -110,7 +110,7 @@ class BlockSvg extends Block {
|
||||
* mutation dialog button and UI to appear.
|
||||
* @type {undefined|?function(WorkspaceSvg):!BlockSvg}
|
||||
*/
|
||||
this.decompose = undefined;
|
||||
this.decompose = this.decompose;
|
||||
|
||||
/**
|
||||
* An optional method called when a mutator dialog saves its content.
|
||||
@@ -119,13 +119,21 @@ class BlockSvg extends Block {
|
||||
* method for the default mutation dialog button and UI to appear.
|
||||
* @type {undefined|?function(!BlockSvg)}
|
||||
*/
|
||||
this.compose = undefined;
|
||||
this.compose = this.compose;
|
||||
|
||||
/**
|
||||
* An optional method called by the default mutator UI which gives the block
|
||||
* a chance to save information about what child blocks are connected to
|
||||
* what mutated connections.
|
||||
* @type {undefined|?function(!BlockSvg)}
|
||||
*/
|
||||
this.saveConnections = this.saveConnections;
|
||||
|
||||
/**
|
||||
* An optional method for defining custom block context menu items.
|
||||
* @type {undefined|?function(!Array<!Object>)}
|
||||
*/
|
||||
this.customContextMenu = undefined;
|
||||
this.customContextMenu = this.customContextMenu;
|
||||
|
||||
/**
|
||||
* An property used internally to reference the block's rendering debugger.
|
||||
|
||||
Reference in New Issue
Block a user