Menu

Vecta.Menu

Vecta menu object. Wrapper for a custom menu that can be attached to shapes.

NameTypeAttributesDescription
shapeVecta.Shape

The shape to add a menu to

indexnumberoptional

The index of the menu. If undefined, create a custom menu, otherwise use the menu at the provided index.

Methods

.action([action]) Returns: Vecta.Menu

Get or set the action to be performed when the menu is clicked.

NameTypeAttributesDescription
actionstringoptional

A valid JavaScript expression.

Returns:

Returns the Vecta.Menu object.

.delete()

Delete the custom menu.

.disable([disable]) Returns: Vecta.Menu

Get or set menu to be disabled.

NameTypeAttributesDescription
disablestring|booleanoptional

Undefined to get if the menu is disabled.

A valid Javascript expression that evaluates to true or false, to set menu to disabled.

Returns:

Returns the Vecta.Menu object.

.select([select]) Returns: Vecta.Menu

Get or set the selected status of the menu object.

NameTypeAttributesDescription
selectstring|booleanoptional

Undefined to get the selected status of the menu.

A valid Javascript expression that evaluates to true or false, to set menu selected status.

Returns:

Returns the menu option

.title([title]) Returns: Vecta.Menu

Get or set the title of menu.

NameTypeAttributesDescription
titlestringoptional

Title of menu. Can be a valid JavaScript expression.

Returns:

Returns the Vecta.Menu object.