The orient module provides functions to determine the optimum orientation of a tooltip if auto-sizing is set to true, and to set the proper CSS values for the tooltip's div elements.
Methods
(inner) position(targetElement, target)
Sets the position of the tooltip relative to the HTML element with which it is associated.
Parameters:
Name | Type | Description |
---|---|---|
targetElement |
string | The unique id of the HTML element that owns the tooltip. |
target |
Tip | The object containing all of the current tooltip's options and content. |
(inner) optimumOrientation(targetElement, target) → {string}
Determines the best side upon which to place the tooltip. If auto-positioning is on, the preferred-orientation setting will be honored unless there is insufficient viewport space. in this case, the position with the most available space will be used.
Parameters:
Name | Type | Description |
---|---|---|
targetElement |
string | The DOM element that is associated with the tooltip. |
target |
Tip | The Tip class object containing all of the current tooltip's options and content. |
Returns:
One of ['left' | 'right' | 'top' | 'bottom'].
- Type
- string
(inner) getOrientation(targetElement, target) → {string}
Selects the appropriate orientation by deconflicting auto-positioning, prefererd-orientation settings in the Tip{} class object.
Parameters:
Name | Type | Description |
---|---|---|
targetElement |
string | The DOM element that is associated with the tooltip. |
target |
Tip | The Tip class object containing all of the current tooltip's options and content. |
Returns:
One of ['left' | 'right' | 'top' | 'bottom'].
- Type
- string