new ActionMenu(listItems, title, successCb, cancelCb, preventFocusChange)
ActionMenu displays a list of user-selectable actions in an overlay.
An example of this would be when the user selects a single activity form
a list of several activities. Each ActionMenu instance maintains its own
dom and event listeners.
Parameters:
Name | Type | Description |
---|---|---|
listItems | Array | An array of objects to display. |
title | String | The content of the header. |
successCb | function | Called when the user selects an option. |
cancelCb | function | Called when the menu is cancelled. |
preventFocusChange | Boolean | Set to true to prevent focus changing. |
Members
-
visible
-
Whether or not the ActionMenu is visible.
Methods
-
buildMenu()
-
Builds the dom for the menu.
-
handleEvent(evt)
-
General event handler interface.
Handles submission and cancellation events.Parameters:
Name Type Description evt DOMEvent The event.
-
hide(callback)
-
Hides the ActionMenu.
Parameters:
Name Type Description callback function The callback to call after hiding.
-
preventFocusChange(evt)
-
When IME switcher shows, prevent the keyboard focus getting changed.
Parameters:
Name Type Description evt DOMEvent The event.
-
start()
-
Builds dom and adds event listeners
-
stop()
-
Removes the dom and stops event listeners