A reference to the HTML element which is currently tool-tipped, if any.
A cached reference to the global tooltip element
Static
LOCKED_The number of pixels buffer around a locked tooltip zone before they should be dismissed.
Static
TOOLTIP_The number of milliseconds delay which activates a tooltip on a "long hover".
Static
TOOLTIP_The directions in which a tooltip can extend, relative to its tool-tipped element.
Static
TOOLTIP_An amount of margin which is used to offset tooltips from their anchored element.
Static
implementationRetrieve the configured TooltipManager implementation.
Activate the tooltip for a hovered HTML element which defines a tooltip localization key.
The HTML element being hovered.
Optional
options: {Additional options which can override tooltip behavior.
Optional
cssClass?: stringAn optional, space-separated list of CSS classes to apply to the activated
tooltip. If this is not provided, the CSS classes are acquired from the
data-tooltip-class
attribute of the element or one of its parents.
Optional
direction?: "UP" | "DOWN" | "LEFT" | "RIGHT" | "CENTER"An explicit tooltip expansion direction. If this
is not provided, the direction is acquired from the data-tooltip-direction
attribute of the element or one of its parents.
Optional
html?: string | HTMLElementExplicit HTML to inject into the tooltip rather than using
tooltip text. If passed as a string, the HTML string is cleaned with
foundry.utils.cleanHTML. An explicit HTML string may also
be set with the data-tooltip-html
attribute on the element.
Optional
locked?: booleanAn optional boolean to lock the tooltip after creation. Defaults to false.
Optional
text?: stringExplicit tooltip text to display. If this is not provided the tooltip text is
acquired from the element's data-tooltip-text
attribute if present and
otherwise from its data-tooltip
attribute. The data-tooltip
text will be
automatically localized. If data-tooltip
is not a localization string, the
text is rendered as HTML (cleaned). Both options.text
and data-tooltip-text
do not support HTML. It is not recommended to use data-tooltip
for plain text
and HTML as it could cause an unintentional localization. Instead use
data-tooltip-text
and data-tooltip-html
, respectively.
Activate interactivity by listening for hover events on HTML elements which have a data-tooltip defined.
Internal
Clear any pending activation workflow.
Create a locked tooltip at the given position.
A position object with coordinates for where the tooltip should be placed
Explicit bottom position for the tooltip
Explicit left position for the tooltip
Explicit right position for the tooltip
Explicit top position for the tooltip
Explicit tooltip text or HTML to display.
Optional
options: { cssClass?: string } = {}Additional options which can override tooltip behavior.
Optional
cssClass?: stringAn optional, space-separated list of CSS classes to apply to the activated tooltip.
Deactivate the tooltip from a previously hovered HTML element.
Dismiss a given locked tooltip.
The locked tooltip to dismiss.
Dismiss the set of active locked tooltips.
Lock the current tooltip.
Protected
_determineProtected
If an explicit tooltip expansion direction was not specified, figure out a valid direction based on the bounds of the target element and the screen.
Protected
_onProtected
Handle dismissing a locked tooltip.
The click event.
Protected
_onProtected
Handle a request to lock the current tooltip.
The click event.
Protected
_setProtected
Set tooltip position relative to an HTML element using an explicitly provided data-tooltip-direction.
The tooltip expansion direction specified by the element or a parent element.
Protected
_setProtected
Apply inline styling rules to the tooltip for positioning and text alignment.
Optional
position: object = {}An object of positioning data, supporting top, right, bottom, left, and textAlign
A singleton Tooltip Manager class responsible for rendering and positioning a dynamic tooltip element which is accessible as
game.tooltip
.See
foundry.Game#tooltip
Example: API Usage
Example: HTML Usage