The containing HTML element within which the menu is positioned
A CSS selector which activates the context menu.
An Array of entries to display in the menu
Optional
options: { Additional options to configure the context menu.
Optionally override the triggering event which can spawn the menu
A function to call when the context menu is opened.
A function to call when the context menu is closed.
The target HTMLElement being selected
The target CSS selector which activates the menu
An interaction event name which activates the menu
The array of menu items being rendered
A function to call when the context menu is opened.
A function to call when the context menu is closed.
Track which direction the menu is expanded in
Private
#targetThe parent HTML element to which the context menu is attached
A convenience accessor to the context menu HTML object
Render the Context Menu by iterating over the menuItems it contains. Check the visibility of each menu item, and only render ones which are allowed by the item's logical condition. Attach a click handler to each item which is rendered.
The target element to which the context menu is attached
Optional
options: { The event that triggered the context menu opening.
A Promise that resolves when the open animation has completed.
Protected
_setProtected
Set the position of the context menu, taking into consideration whether the menu should expand upward or downward
The context menu element.
The element that the context menu was spawned on.
Optional
options: { The event that triggered the context menu opening.
Private
#onStatic
createCreate a ContextMenu for this Application and dispatch hooks.
The Application this ContextMenu belongs to.
The Application's rendered HTML.
The target CSS selector which activates the menu.
The array of menu items being rendered.
Optional
options: { Additional options to configure context menu initialization.
The name of the hook to call.
Static
event
Display a right-click activated Context Menu which provides a dropdown menu of options A ContextMenu is constructed by designating a parent HTML container and a target selector An Array of menuItems defines the entries of the menu which is displayed