Methods
(static) createMenu(menuName, menuConfigopt)
Create a new menu
Example
MenuSystem.MenuManager.createMenu("MyMenu", {
context: myContext,
builder: MenuSystem.MyLovelyMenuBuilder
keepOpen: false,
onOpen: ()=>{console.log("MyMenu was opened!")},
onClose: ()=>{console.log("MyMenu was closed!")},
});
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
menuName |
String | The name of the Menu | |
menuConfig |
MenuSystem.Menu~menuConfig |
<optional> |
The configuration of the Menu |
(static) registerMenuItem(menuName, menuItemConfig) → {Object}
Registers a new MenuItem for the given named menu. MenuItem's can be registered both before and after the menu is created.
Example
MenuSystem.MenuManager.registerMenuItem("MyMenu", {
label: "MyMenuItem",
order: 10.
onAction: ()=>{console.log("MyMenuItem clicked!");}
onOpen: ()=>{return true;}
});
Parameters:
Name | Type | Description |
---|---|---|
menuName |
String | The name of the menu to register this MenuItem for |
menuItemConfig |
MenuSystem.MenuItem~menuItemConfig | The configuration for this MenuItem |
Returns:
- Delete object, with a single method delete(), that removes this menuItemConfig and all menuitems associated with it
- Type
- Object