Creates a ContextMenu
.
The ContextMenu
will be initially hidden.
Optional
cfg: {ContextMenu
configuration.
The context, which is passed into the item callbacks. This can also be dynamically set on ContextMenu#context. This must be set before calling ContextMenu#show.
Optional
enabled?: booleanWhether this ContextMenu
is initially enabled. ContextMenu#show does nothing while this is false
.
Optional
hideOnAction?: booleanWhether this ContextMenu
automatically hides after we select a menu item. Se false if we want the menu to remain shown and show any updates to its item titles, after we've selected an item.
Optional
hideOnMouseDown?: booleanWhether this ContextMenu
automatically hides whenever we mouse-down or tap anywhere in the page.
The context menu items. These can also be dynamically set on ContextMenu#items. See the class documentation for an example.
Gets the ContextMenu
context.
Sets the ContextMenu
context.
The context can be any object that you need to be provides to the callbacks configured on ContextMenu#items.
This must be set before calling ContextMenu#show.
Gets whether this ContextMenu
is enabled.
ContextMenu#show does nothing while this is false
.
Sets whether this ContextMenu
is enabled.
Hides the menu when disabling.
Gets the ContextMenu
items.
Sets the ContextMenu
items.
These can be updated dynamically at any time.
See class documentation for an example.
Gets whether this ContextMenu
is currently shown or not.
Whether this ContextMenu
is shown.
Shows this ContextMenu
at the given page coordinates.
Does nothing when ContextMenu#enabled is false
.
Logs error to console and does nothing if ContextMenu#context has not been set.
Fires a "shown" event when shown.
Page X-coordinate.
Page Y-coordinate.
An HTML context menu.
See @xeokit/sdk/contextmenu for usage.