Interface MenuTemplate

A template that declaratively describes a pop-up menu and its logic.

Hierarchy

Index

Properties

Optional beforeShow

If defined, this function is called just before the menu is shown. It will be passed the template of the menu that will be shown.

Optional id

id: string

An optional value that can be set to assist in implementing the menu logic. It is ignored by showMenu and does not affect any DOM ids.

Optional items

An array of templates describing the items that will comprise the menu.

Optional onCancel

If defined, this function is called if the menu is closed without selecting an item. It will be passed the template of the menu that was cancelled.

Optional onClose

If defined, this function is called after the menu is closed. It will be passed the template of the menu that closed. Unlike onCancel, it will be called whether or not a menu item is selected.

Optional onUse

If defined, this function is called if an item is selected and that item does not specify its own onUse function. It will be passed the template of the selected menu item.

pageX

pageX: number

The x-offset at which to display the menu, relative to the left edge of the document. The actual location of the menu may be adjusted to ensure visibility.

pageY

pageY: number

The y-offset at which to display the menu, relative to the top edge of the document. The actual location of the menu may be adjusted to ensure visibility.

Optional preselect

preselect: number

The optional index of a menu item that will be focused and highlighted when the menu is shown. The default is not to preselect an item.

This API is still under development and is subject to change. Copyright © Math I Can Do Solutions Incorporated and/or its licensors.