new ContextMenu()
- Source:
Properties:
| Name | Type | Description |
|---|---|---|
defaults |
ContextMenuOptions | Object | |
handle |
ContextMenuEventHandler | |
operations |
ContextMenuOperations | |
menus |
Object.<string, ContextMenuData> | |
counter |
number | Internal counter to keep track of different menu's on the page. |
initialized |
boolean | Flag the menu as initialized. |
Example
// You can call this class directly and skip going through jQuery, although it still requires jQuery to run.
const manager = new ContextMenu();
manager.execute("create", options);
Methods
-
<static> buildOptions(userOptions)
-
Build the options, by applying the Manager, defaults, user options and normalizing the context.
Parameters:
Name Type Description userOptionsContextMenuOptions - Source:
Returns:
- Type
- ContextMenuOptions
-
<static> create(options)
-
Create a ContextMenu
Parameters:
Name Type Description optionsContextMenuOptions - Source:
-
<static> destroy(options)
-
Destroy the ContextMenu
Parameters:
Name Type Description optionsContextMenuOptions - Source:
-
<static> html5(options)
-
if
Parameters:
Name Type Description optionsContextMenuOptions | boolean - Source:
-
<static> normalizeArguments(operation, options)
-
Parameters:
Name Type Description operationstring | Object optionsstring | Object | ContextMenuOptions - Source:
Returns:
- Type
- Object
-
<static> update(options)
-
Update the ContextMenu or all ContextMenu's
Parameters:
Name Type Description optionsContextMenuOptions - Source:
-
execute(operation, options)
-
Parameters:
Name Type Description operationstring | ContextMenuOptions optionsstring | ContextMenuOptions - Source:
Returns:
- Type
- ContextMenu
-
getInputValues(contextMenuData, data)
-
export values from
<input>commandsParameters:
Name Type Description contextMenuDataContextMenuData ContextMenuData object
dataObject Values object
- Source:
Returns:
- Values of input elements
- Type
- Object
-
setInputValues(contextMenuData, data)
-
import values into
<input>commandsParameters:
Name Type Description contextMenuDataContextMenuData ContextMenuData object
dataObject Values to set
- Source:
Returns:
- Type
- undefined