blockly > ContextMenuRegistry > getContextMenuOptions

ContextMenuRegistry.getContextMenuOptions() method

Gets the valid context menu options for the given scope. Options are only included if the preconditionFn shows they should not be hidden.

Signature:

getContextMenuOptions(scope: Scope, menuOpenEvent: Event): ContextMenuOption[];

Parameters

Parameter Type Description
scope Scope Current scope of context menu (i.e., the exact workspace or block being clicked on).
menuOpenEvent Event Event that caused the menu to open.

Returns:

ContextMenuOption[]

the list of ContextMenuOptions