Class: ContextMenu

ContextMenu

The ContextMenu is the core class that manages contextmenu's. You can call this class directly and skip going through jQuery.


new ContextMenu()

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.

Source:
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
userOptions ContextMenuOptions
Source:
Returns:
Type
ContextMenuOptions

<static> create(options)

Create a ContextMenu

Parameters:
Name Type Description
options ContextMenuOptions
Source:

<static> destroy(options)

Destroy the ContextMenu

Parameters:
Name Type Description
options ContextMenuOptions
Source:

<static> html5(options)

if is not handled by the browser, or options was a bool true, initialize $.contextMenu for them.

Parameters:
Name Type Description
options ContextMenuOptions | boolean
Source:

<static> normalizeArguments(operation, options)

Parameters:
Name Type Description
operation string | Object
options string | Object | ContextMenuOptions
Source:
Returns:
Type
Object

<static> update(options)

Update the ContextMenu or all ContextMenu's

Parameters:
Name Type Description
options ContextMenuOptions
Source:

execute(operation, options)

Parameters:
Name Type Description
operation string | ContextMenuOptions
options string | ContextMenuOptions
Source:
Returns:
Type
ContextMenu

getInputValues(contextMenuData, data)

export values from <input> commands

Parameters:
Name Type Description
contextMenuData ContextMenuData

ContextMenuData object

data Object

Values object

Source:
Returns:
  • Values of input elements
Type
Object

setInputValues(contextMenuData, data)

import values into <input> commands

Parameters:
Name Type Description
contextMenuData ContextMenuData

ContextMenuData object

data Object

Values to set

Source:
Returns:
Type
undefined