blockly > ContextMenuRegistry > getContextMenuOptions
ContextMenuRegistry.getContextMenuOptions() method
Gets the valid context menu options for the given scope type (e.g. block or workspace) and scope. Blocks are only shown if the preconditionFn shows they should not be hidden.
Signature:
getContextMenuOptions(scopeType: ScopeType, scope: Scope): ContextMenuOption[];
Parameters
Parameter | Type | Description |
---|---|---|
scopeType | ScopeType | Type of scope where menu should be shown (e.g. on a block or on a workspace) |
scope | Scope | Current scope of context menu (i.e., the exact workspace or block being clicked on) |
Returns:
ContextMenuOption[]
the list of ContextMenuOptions