Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Tooltip

A Tooltip is a component for displaying additional information or content in a popover when the target element is hovered over or clicked on.

export

Hierarchy

Index

Constructors

constructor

  • Initializes and returns a tooltip instance configured with the specified content and options.

    memberof

    Tooltip

    Parameters

    • Optional content: string | HTMLElement
    • Optional opts: TooltipOptions

    Returns Tooltip

Accessors

$close

  • get $close(): any
  • Returns any

$content

  • get $content(): any
  • Returns any

$el

  • get $el(): any
  • DOM element.

    readonly
    memberof

    Tooltip

    Returns any

$target

  • get $target(): any
  • Target DOM element.

    readonly
    memberof

    Tooltip

    Returns any

size

  • Size of the tooltip.

    readonly
    memberof

    Tooltip

    Returns Size

visible

  • get visible(): boolean
  • A Boolean indicating whether the tooltip is currently visible.

    readonly
    memberof

    Tooltip

    Returns boolean

Methods

attachTo

  • Sets the current target.

    memberof

    Tooltip

    Parameters

    • element: any

    Returns Tooltip

destroy

  • destroy(): void
  • Detaches the tooltip from its associated target and removes it from the DOM.

    memberof

    Tooltip

    Returns void

detach

  • Hides the tooltip and removes its associated with the current target.

    memberof

    Tooltip

    Returns Tooltip

has

  • has(type: string): boolean
  • Returns whether the listeners are registered for the specified event name.

    memberof

    EventDispatcher

    Parameters

    • type: string

    Returns boolean

hide

  • Hides the tooltip.

    memberof

    Tooltip

    Returns Tooltip

off

  • Removes a registered listener function for the specified event.

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to remove the listener for.

    • callback: Function

      Handler function to remove so it won't be executed next time the event is triggered.

    • Default value scope: any = null

    Returns EventDispatcher

offAll

on

  • on(type: string, callback: Function, scope?: any, priority?: number): EventDispatcher
  • Registers a listener function to be executed each time an event occurs

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.

    • callback: Function

      Handler function to be called when the event occurs

    • Default value scope: any = null
    • Default value priority: number = 0

    Returns EventDispatcher

once

  • once(type: string, callback: Function, scope?: any, priority?: number): EventDispatcher
  • Registers a listener function to be executed the first time an event occurs.

    memberof

    EventDispatcher

    Parameters

    • type: string

      Name of the event to listen for. Value can contain multiple event names separated by spaces to trigger the same handler function for each event name.

    • callback: Function

      Handler function to be called when the event occurs

    • Default value scope: any = null
    • Default value priority: number = 0

    Returns EventDispatcher

position

  • position(x?: number | Element, y?: number): Tooltip
  • Updates the tooltip's position.

    This method accepts either an x and y pixel coordinate from which to position the tooltip. Alternatively, a single DOM element argument can be provided which will be used when calculating the new position.

    memberof

    Tooltip

    Parameters

    • Optional x: number | Element
    • Optional y: number

    Returns Tooltip

setContent

  • setContent(content: string | HTMLElement): Tooltip
  • Sets the content, which can either be a text string or HTML string.

    memberof

    Tooltip

    Parameters

    • content: string | HTMLElement

    Returns Tooltip

show

  • show(hideOthers?: boolean): Tooltip
  • Shows the tooltip from the previously configured target.

    To present the tooltip from a different target, call attachTo() before showing the tooltip.

    memberof

    Tooltip

    Parameters

    • Default value hideOthers: boolean = true

    Returns Tooltip

toggle

  • Toggles the visibility of the tooltip.

    memberof

    Tooltip

    Returns Tooltip

trigger

  • Triggers the specified event so that all registered listeners will be executed with the specified parameters.

    memberof

    EventDispatcher

    Parameters

    • type: any

      Event name to trigger

    • Default value data: any = null

    Returns EventDispatcher

Generated using TypeDoc