Options
All
  • Public
  • Public/Protected
  • All
Menu

An object which implements a universal context menu. Tweaked to use inline svg icons

Hierarchy

  • ContextMenu
    • ContextMenuSvg

Implements

  • IDisposable

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Construct a new context menu.

    Parameters

    • options: IOptions

      The options for initializing the menu.

    Returns ContextMenuSvg

Properties

Protected _isDisposed

_isDisposed: boolean

Protected _opened

_opened: Signal<ContextMenu, void>

Readonly menu

menu: MenuSvg

Accessors

isDisposed

  • get isDisposed(): boolean
  • Test whether the context menu is disposed.

    Returns boolean

opened

  • get opened(): ISignal<ContextMenu, void>
  • A signal fired when the context menu is opened.

    Returns ISignal<ContextMenu, void>

Methods

addItem

  • addItem(options: IItemOptions): IDisposable
  • Add an item to the context menu.

    Parameters

    • options: IItemOptions

      The options for creating the item.

    Returns IDisposable

    A disposable which will remove the item from the menu.

dispose

  • dispose(): void
  • Dispose of the resources held by the context menu.

    Returns void

open

  • open(event: MouseEvent): boolean
  • Open the context menu in response to a 'contextmenu' event.

    Parameters

    • event: MouseEvent

      The 'contextmenu' event of interest.

    Returns boolean

    true if the menu was opened, or false if no items matched the event and the menu was not opened.

    Notes

    This method will populate the context menu with items which match the propagation path of the event, then open the menu at the mouse position indicated by the event.

Generated using TypeDoc