Displays a command tooltip above the currently active line selection, with clickable elements.

Internally it is a composite of two tooltips, one for the main tooltip and one for the overflowing commands. The commands are added sequentially in registration order. When attached to an editor, it is either always shown or only when the active line is hovered with mouse, depending on the alwaysShow property.

Hierarchy (View Summary)

Constructors

Properties

commands: {}
editor: Editor
elements: {}
eventListeners: {}
maxElementsOnTooltip: number
moreOptions: Tooltip
moreOptionsEl: HTMLDivElement
parentNode: HTMLElement
tooltip: Tooltip
tooltipEl: HTMLDivElement

Methods

  • Attaches the clickable command bar tooltip to an editor

    Depending on the alwaysShow parameter it either displays the tooltip immediately, or subscribes to the necessary events to display the tooltip on hover.

    Parameters

    Returns void

  • Detaches the tooltip from the editor.

    Returns void

  • Registers a command on the command bar tooltip.

    The commands are added in sequential order. If there is not enough space on the main toolbar, the remaining elements are added to the overflow menu.

    Parameters

    Returns void

  • Sets the display mode of the tooltip

    When true, the tooltip is always displayed while it is attached to an editor. When false, the tooltip is displayed only when the mouse hovers over the active editor line.

    Parameters

    • alwaysShow: boolean

    Returns void

  • Updates each command element in the tooltip.

    This is automatically called on certain events, but can be called manually as well.

    Returns void

  • Updates the position of the command bar tooltip. It aligns itself above the active line in the editor.

    Returns void