Foundry Virtual Tabletop - API Documentation - Version 14
    Preparing search index...

    Class ProseMirrorDropDown

    A class responsible for creating a drop-down.

    Index

    Constructors

    • A class responsible for rendering a menu drop-down.

      Parameters

      • title: string

        The default title.

      • items: ProseMirrorDropDownEntry[]

        The configured menu items.

      • Optionaloptions: {
            cssClass?: string;
            icon?: string;
            menu?: string;
            onAction?: (arg0: MouseEvent) => any;
            weight?: number;
        } = {}
        • OptionalcssClass?: string

          The menu CSS class name. Required if providing an action.

        • Optionalicon?: string

          Use an icon for the dropdown rather than a text label.

        • Optionalmenu?: string

          An associated menu that this item collapses under.

        • OptionalonAction?: (arg0: MouseEvent) => any

          A callback to fire when a menu item is clicked.

        • Optionalweight?: number

          The relative importance of an entry. Entries with lower weight collapse first.

      Returns ProseMirrorDropDown

    Accessors

    • An associated menu that this item collapses under.

      Returns string

    • get weight(): number

      The relative importance of this entry.

      Returns number

    Methods

    • Attach event listeners.

      Parameters

      • html: HTMLMenuElement

        The root menu element.

      Returns void

    • Recurse through the menu structure and apply a function to each item in it.

      Parameters

      • fn: (arg0: ProseMirrorDropDownEntry) => boolean

        The function to call on each item. Return false to prevent iterating over any further items.

      Returns void

    • Construct the drop-down menu's HTML.

      Returns string

      HTML contents as a string.

    • Protected

      Handle spawning a drop-down menu.

      Parameters

      • event: PointerEvent

        The triggering event.

      Returns void