- Source:
Properties:
Name | Type | Argument | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
selector |
null | string | Selector on which the contextMenu triggers. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
items |
Object.<string, ContextMenuItem> | Object with items to be listed in contextMenu. See ContextMenuItem for a full documentation on how to build your menu items. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
appendTo |
JQuery.Selector | DOMElement |
<optional> |
document.body | Specifies the selector |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
trigger |
'right' | 'left' | 'hover' | 'touchstart' | 'none' | left | Method to trigger context menu ["right", "left", "hover", "touchstart", "none"]. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
itemClickEvent |
string |
<nullable> |
Allows the selection of the click event instead of the mouseup event to handle the user mouse interaction with the contexMenu. The default event is This option is global: the first contexMenu registered sets it. To change it afterwards all the contextMenu have to be unregistered with |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
hideOnSecondTrigger |
boolean | false | Flag denoting if a second trigger should close the menu, as long as the trigger happened on one of the trigger-element's child nodes. This overrides the reposition option. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
selectableSubMenu |
boolean | false | Ability to select ContextMenuItem containing a submenu. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
reposition |
boolean | true | flag denoting if a second trigger should simply move ( |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
delay |
number | 200 | ms to wait before showing a hover-triggered context menu. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
autoHide |
boolean | true | Hide menu when mouse leaves trigger / menu elements. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
zIndex |
number | function | 1 | offset to add to zIndex |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
className |
string | Class to be appended to the root menu. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
classNames |
Object | Default classname configuration to be able avoid conflicts in frameworks. Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
animation |
Object | Animation settings Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
events |
Object | Event callbacks. This is the trigger element, first argument is the event, and the second argumant ContextMenuData. Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
callback |
ContextMenuItemCallback | Global callback called then a ContextMenuItem is clicked. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
build |
ContextMenuBuildCallback | false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
position |
position | Callback to override the position of the context menu. The function is executed in the context of the trigger object. The first argument is a jQuery.Event. The second argument is the ContextMenuData object, which has a The |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
determinePosition |
determinePosition | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
positionSubmenu |
positionSubmenu | Callback tha positions a submenu |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
_hasContext |
boolean | Set to true if the call was done from an element. |
Methods
-
determinePosition($menu)
-
Determine the position for a root menu.
Parameters:
Name Type Description $menu
JQuery - Source:
-
position(e, currentMenuData, x, y)
-
Position the root menu.
Parameters:
Name Type Description e
JQuery.Event currentMenuData
ContextMenuData x
number | string y
number | string - Source:
-
positionSubmenu(e, $menu)
-
Position a submenu.
Parameters:
Name Type Description e
JQuery.Event $menu
JQuery - Source: