Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

constructor

Properties

Private anchor

anchor: HTMLElement

The element the menu is anchored to.

type

{HTMLElement}

Protected className

className: "CtxtMenu_ContextMenu" | "CtxtMenu_Menu" | "CtxtMenu_MenuArrow" | "CtxtMenu_MenuActive" | "CtxtMenu_MenuCheck" | "CtxtMenu_MenuClose" | "CtxtMenu_MenuDisabled" | "CtxtMenu_MenuItem" | "CtxtMenu_MenuLabel" | "CtxtMenu_MenuRadioCheck" | "CtxtMenu_MenuRule" | "CtxtMenu_MousePost" | "CtxtMenu_RTL" | "CtxtMenu_Attached" | "CtxtMenu_Info" | "CtxtMenu_InfoClose" | "CtxtMenu_InfoContent" | "CtxtMenu_InfoSignature" | "CtxtMenu_InfoTitle" | "CtxtMenu_MenuFrame" = HtmlClasses['CONTEXTMENU']
override

Private frame

frame: HTMLElement

The div that holds the entire menu.

type

{HTMLElement}

Private moving

moving: boolean = false

Flag to avoid redoing taborder if we are between elements.

type

{boolean}

Protected role

role: string = "menu"
override

Private store_

store_: MenuStore = new MenuStore(this)

A store the menu belongs to.

type

{MenuStore}

Protected variablePool

variablePool: VariablePool<string | boolean>

The variable pool of the context menu.

type

{VarialbePool}

Private widgets

widgets: Postable[] = []

Registry of currently open widgets.

type

{Array.}

Methods

addAttributes

  • addAttributes(attributes: object): void
  • Adds a attributes and values to the HTML element.

    Parameters

    • attributes: object

      A dictionary of attributes.

      • [attr: string]: string

    Returns void

addEvents

  • addEvents(element: HTMLElement): void

bubbleKey

  • bubbleKey(): void

click

  • click(event: MouseEvent): void

Protected display

  • display(): void

down

  • down(event: KeyboardEvent): void

escape

  • escape(event: KeyboardEvent): void

find

  • find(id: string): Item

focus

  • focus(): void

generateHtml

  • generateHtml(): void

generateMenu

  • generateMenu(): void

getFocused

  • getFocused(): Item

getFrame

  • getFrame(): HTMLElement
  • Returns HTMLElement

    The frame element wrapping all the elements of the menu.

getHtml

  • getHtml(): HTMLElement

getItems

  • getItems(): Item[]

getPool

getStore

isPosted

  • isPosted(): boolean

keydown

  • keydown(event: KeyboardEvent): void

left

  • left(event: KeyboardEvent): void

mousedown

  • mousedown(event: MouseEvent): void

mouseout

  • mouseout(event: MouseEvent): void

mouseover

  • mouseover(event: MouseEvent): void

mouseup

  • mouseup(event: MouseEvent): void

Private move_

  • move_(next: HTMLElement): void
  • Moves to the given next element.

    Parameters

    • next: HTMLElement

      The next element in the sequence.

    Returns void

Protected parseItems

  • parseItems(items: any[]): void

Private parseVariable

  • parseVariable(__namedParameters: object): void
  • Parses a JSON respresentation of a variable and inserts it into the variable pool of the context menu.

    Parameters

    • __namedParameters: object
      • action: function
          • (x: string | boolean): void
          • Parameters

            • x: string | boolean

            Returns void

      • name: string
      • value: string | boolean

    Returns void

post

  • post(): void
  • post(x: number, y: number): void
  • post(event: Event): void
  • post(element: HTMLElement): void

registerWidget

  • registerWidget(widget: Postable): void
  • Registers widgets that are opened by the menu.

    Parameters

    Returns void

right

  • right(event: KeyboardEvent): void

setFocused

  • setFocused(item: Item): void

setHtml

  • setHtml(html: HTMLElement): void

space

  • space(event: KeyboardEvent): void

Protected stop

  • stop(event: Event): void

unfocus

  • unfocus(): void

unpost

  • unpost(): void

unpostSubmenus

  • unpostSubmenus(): void

unpostWidgets

  • unpostWidgets(): void
  • Closes all widgets that were opened from this menu.

    Returns void

unregisterWidget

  • unregisterWidget(widget: Postable): void

up

  • up(event: KeyboardEvent): void

Static parse

  • Parses a JSON respresentation of a variable pool.

    Parameters

    • __namedParameters: object
      • menu: object
        • id: string
        • items: Array<Object>
        • pool: Array<Object>

    Returns ContextMenu

    The new context menu object.

Generated using TypeDoc