Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

constructor

  • new Command(menu: Menu, content: string, command: Function, id?: string): Command
  • constructor
    extends

    {AbstractItem}

    Parameters

    • menu: Menu

      The context menu or sub-menu the item belongs to.

    • content: string

      The content of the menu item.

    • command: Function

      The command to be executed on triggering the menu item.

    • Optional id: string

      Optionally the id of the menu item.

    Returns Command

Properties

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['MENUITEM']

Class name.

type

{HtmlClass}

Private command

command: Function = null

Protected disabled

disabled: boolean = false

Flag indicating if element is disabled.

type

{boolean}

Protected role

role: string = "menuitem"

Aria role element.

type

{string}

Methods

Protected activate

  • activate(): void

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 deactivate

  • deactivate(): void

disable

  • disable(): void

down

  • down(event: KeyboardEvent): void

enable

  • enable(): void

escape

  • escape(event: KeyboardEvent): void

executeAction

  • executeAction(): void

focus

  • focus(): void

generateHtml

  • generateHtml(): void

getContent

  • getContent(): string

getHtml

  • getHtml(): HTMLElement

getId

  • getId(): string

getMenu

getType

  • getType(): string

hide

  • hide(): void

isHidden

  • isHidden(): 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

press

  • press(): void

registerCallback

  • registerCallback(func: Function): void

right

  • right(event: KeyboardEvent): void

setHtml

  • setHtml(html: HTMLElement): void

setMenu

  • setMenu(menu: Menu): void

show

  • show(): void

space

  • space(event: KeyboardEvent): void

Protected stop

  • stop(event: Event): void

unfocus

  • unfocus(): void

unregisterCallback

  • unregisterCallback(func: Function): void

up

  • up(event: KeyboardEvent): void

Static parse

  • parse(__namedParameters: object, menu: Menu): Command
  • Parses a JSON respresentation of a command item.

    Parameters

    • __namedParameters: object
      • action: Function
      • content: string
      • id: string
    • menu: Menu

      The menu the item is attached to.

    Returns Command

    The new command object.

Generated using TypeDoc