Use Context Menu registry for block-level menu options (#4032)

Use registry for block-level context menu items.
This commit is contained in:
Maribeth Bottorff
2020-07-10 19:11:48 -07:00
committed by GitHub
parent 40efb59a34
commit e4bbd451a3
4 changed files with 398 additions and 297 deletions

View File

@@ -558,6 +558,24 @@ Blockly.Workspace.prototype.hasBlockLimits = function() {
return this.options.maxBlocks != Infinity || !!this.options.maxInstances;
};
/**
* Gets the undo stack for workplace.
* @return {!Array.<!Blockly.Events.Abstract>} undo stack
* @package
*/
Blockly.Workspace.prototype.getUndoStack = function() {
return this.undoStack_;
};
/**
* Gets the redo stack for workplace.
* @return {!Array.<!Blockly.Events.Abstract>} redo stack
* @package
*/
Blockly.Workspace.prototype.getRedoStack = function() {
return this.redoStack_;
};
/**
* Undo or redo the previous action.
* @param {boolean} redo False if undo, true if redo.