ve.ContextMenu

ve.Feature. ve.ContextMenu

Refer to ve.Feature for methods or fields inherited from the parent, such as automatic destructuring.

Represents a ContextMenu Feature that contains a set of components. ve.Window instances are stored in .windows. Recursive.

  • Functional binding: veContextMenu().
  • Inherits feature: ve.Window

The immediate ve.Button element bound to the ContextMenu instance is contained in .element.

Constructor:
  • arg0_components_obj: Object<ve.Component>
  • arg1_options: Object
    • .anchor="left"/"right" - Either 'left'/'right'. Position defaults to the side that has the most space.
    • .button_options: ve.Button.options
    • .height: string
    • .id: string
    • .mode="static_ui" - Either 'static_ui'/'static_window'/'window'.
    • .width: string
    • .x=HTML.mouse_x: number
    • .y=HTML.mouse_y: number
Methods:
  • addContextMenu(arg0_components_obj: Object<ve.Component>, arg1_options: ve.Window.options) | ve.Window - The return .index: number contains the index of the opened window.
    • arg1_options: ve.Window.options
      • .id: string - The ID to prevent duplicate context menus from being opened.
  • close() | this:ve.ContextMenu
  • getCurrentOffset() | number
  • open() | this:ve.ContextMenu
  • removeContextMenu(arg0_index: this:number) | ve.ContextMenu

Constructor

new ve.ContextMenu()

Source:

Extends

Members

Methods

addContextMenu(arg0_components_obj, arg1_optionsopt) → {ve.Window}

Adds a given context menu with a set .options.id to prevent duplicates.

  • Method of: ve.ContextMenu
Source:
Parameters:
Name Type Attributes Description
arg0_components_obj Object
arg1_options Object <optional>
Name Type Attributes Description
anchor string <optional>

Either 'left'/'right', depending on available screen-space.

id string <optional>
Returns:
Type:
ve.Window

close() → {ve.ContextMenu}

Closes the present context menu and all its associated layers.

  • Method of: ve.ContextMenu
Source:
Returns:
Type:
ve.ContextMenu

getCurrentOffset() → {number}

Returns the current X offset in px from the anchored first layer. Default padding is 4px.

  • Method of: ve.ContextMenu
Source:
Returns:
Type:
number

open() → {ve.ContextMenu}

Opens the present context menu with its bound this.components_obj.

  • Method of: ve.ContextMenu
Source:
Returns:
Type:
ve.ContextMenu

removeContextMenu(arg0_index) → {ve.ContextMenu}

Removes a context menu layer based on its order.

  • Method of: ve.ContextMenu
Source:
Parameters:
Name Type Description
arg0_index number
Returns:
Type:
ve.ContextMenu

addComponents(arg0_components_obj)

Adds components to the present this.element.

Overrides:
Source:
Parameters:
Name Type Description
arg0_components_obj Object

close()

Alias for this.remove().

Overrides:
Source:

remove()

Removes the ve.Feature from its static .instances field in addition to unmounting the feature from the DOM.

Overrides:
Source:

removeComponents(arg0_components_obj)

Removes components from the present this.element.

Overrides:
Source:
Parameters:
Name Type Description
arg0_components_obj Object

updateOwner()

Iterates over all present Vercengen components in ve.Feature and sets their owner to the current Feature if they do not already have populated .owner/.owners fields.

Overrides:
Source: