ContextMenu(container, options)

Toast UI ContextMenu Component

new ContextMenu(container, options)

Constructor

Parameters:
Name Type Description
container HTMLElement

container for placing context menu floating layers

options object

options for context menu

Properties
Name Type Attributes Default Description
delay number <optional>
100

delay for displaying submenu

usageStatistics boolean <optional>
true

Send the hostname to google analytics. If you do not want to send the hostname, this option set to false.

Members

zIndex :number

floating layer z-index

Methods

destroy()

Destructor

register(selector, callback, menuItems)

Register context menu

Parameters:
Name Type Description
selector string

css selector for displaying contextmenu at secondary mouse button click

callback function

callback for each menu item clicked

menuItems Array.<MenuItem>

menu item schema

unregister(selector) → {boolean}

Unregister context menu

Parameters:
Name Type Description
selector string

css selector used for register context menu

Returns:
boolean -

whether unregister is successful?