Class CustomContextMenu

Represents a custom context menu that can be created and managed dynamically.

Constructors

Properties

Methods

Constructors

Properties

Element: undefined | HTMLDivElement = undefined

The HTML element representing the context menu.

_inited: boolean = false

Indicates whether the context menu has been initialized.

Methods

  • Creates a custom context menu with specified items and options.

    Parameters

    • items: Record<string, (() => void)>

      An object containing menu item labels and corresponding callback functions.

    • x: number

      The horizontal position of the context menu.

    • y: number

      The vertical position of the context menu.

    • show: boolean = true

      Indicates whether the context menu should be displayed immediately.

    • removeOnSelect: boolean = true

      Indicates whether the context menu should be removed after an item is selected.

    Returns HTMLDivElement

    The HTML element representing the created context menu.

  • Initializes the context menu by adding event listeners. This method should be called before creating a context menu.

    Returns void

Generated using TypeDoc