Description

Tooltip that automatically show and hide themselves on mouseenter and mouseleave events. Will also remove themselves if the node to watch is removed from DOM through a MutationObserver.

Note this is not using Discord's internals but normal DOM manipulation and emulates Discord's own tooltips as closely as possible.

Details

Classes


new (require("Tooltip"))( node, tip, options )

Members


container

Description

Container where the tooltip will be appended.

Details

canShowAbove

Description

Boolean representing if the tooltip will fit on screen above the element

Details

canShowBelow

Description

Boolean representing if the tooltip will fit on screen below the element

Details

canShowLeft

Description

Boolean representing if the tooltip will fit on screen to the left of the element

Details

canShowRight

Description

Boolean representing if the tooltip will fit on screen to the right of the element

Details

observer

Description

Use an observer in show otherwise you'll cause unclosable tooltips

Details

Methods


<static> create()

Description

Alias for the constructor

Details

hide()

Description

Hides the tooltip. Automatically called on mouseleave.

Details

show()

Description

Shows the tooltip. Automatically called on mouseenter. Will attempt to flip if position was wrong.

Details

showAbove()

Description

Force showing the tooltip above the node.

Details

showBelow()

Description

Force showing the tooltip below the node.

Details

showLeft()

Description

Force showing the tooltip to the left of the node.

Details

showRight()

Description

Force showing the tooltip to the right of the node.

Details