PERGOLA LOGO

pergola.ContextMenu

System events: YES.

User events and functions: NO.

A custom context menu can be defined for any object to replace the browser's context menu. Learn more in the CUSTOM CONTEXT MENU section of the Tutorial. Example.

Listed: class properties/methods; prototype properties and methods; instance properties. Prototype properties and methods inherited by the Class superclass are not listed.

class

active

Object reference – initial null. This property is set on opening a custom context menu object. The system handles its closing (pergola.handleCustomContextmenu).

prototype

PROPERTIES

parent

pergola.contextMenus. Do not override.

height

Defined in pergola.presentationAttributes – number (user space units).

"font-size"

Defined in pergola.presentationAttributes – number (user space units) or string.

fill

Defined in pergola.presentationAttributes – string.

filter

Defined in pergola.presentationAttributes – URI.

margin

Defined in pergola.presentationAttributes – number (user space units).

advanceY

Defined in pergola.presentationAttributes – number (user space units).

METHODS

open(point)

point is an object with x and y number or string properties. Adds mousedown event listener to the window object with the handleCustomContextmenu() handler.

close()

Closes this. Removes mousedown event listener from the window object with the handleCustomContextmenu() handler.

build(object)

this inherits the properties specified in object. Prototype properties specified in object are overridden. Creates elements. Returns this.

instance

name

String. If not passed to the constructor, gets a generated XML name (Class).

id

String. The return value of this name.toXML(). This container ID. Used as prefix where other elements' IDs are attributed.

container

<g> element.

items

An object defining pergola.ContextMenuItem objects.

Collection of menu items; new pergola.ContextMenuItem instance for each property in items. Note: contrary to a regular menu, the context menu does not create references for its items.