Class: TooltipComponent

TooltipComponent

new tart.ui.TooltipComponent()

Extends

Methods

inherited protectedbindDomEvents()

Listens to DOM events. This method should be overriden by the implementer, and should keep the component's DOM event bindings.

inherited protectedbindModelEvents()

Listens to the model's events. This method should be overriden by the implementer, and should keep the model's event listeners.

inherited createElements()

Creates the necessary DOM elements and appends them to the root element. This method should be overriden by the implementer.

inherited getElement(){Element}

Returns the dom element attached with the Component instance.

Returns:
Type Description
Element Returns the root DOM element.

This method takes a reference element and uses its offSet and size values along with tooltip element's size values to calculate the right position to display the tooltip. If the toolTip can be shown on the top of the reference element, it positions the tooltip with the distance calculated by this.model's tipOffset and boxOffset values. If it is not to possible to display on top, than it looks for the suitable area to display tooltip. The possible matches are 'right', 'left', 'bottom' and as a default match 'top'.

protectedpositionBottom(refElementOffset, refElementSize, myElementSize){goog.math.Coordinate}

Name Type Description
refElementOffset goog.math.Coordinate
refElementSize goog.math.Size
myElementSize goog.math.Size
Returns:
Type Description
goog.math.Coordinate

protectedpositionLeft(refElementOffset, refElementSize, myElementSize){goog.math.Coordinate}

Name Type Description
refElementOffset goog.math.Coordinate
refElementSize goog.math.Size
myElementSize goog.math.Size
Returns:
Type Description
goog.math.Coordinate

protectedpositionRight(refElementOffset, refElementSize, myElementSize){goog.math.Coordinate}

Name Type Description
refElementOffset goog.math.Coordinate
refElementSize goog.math.Size
myElementSize goog.math.Size
Returns:
Type Description
goog.math.Coordinate

protectedpositionTop(refElementOffset, refElementSize, myElementSize){goog.math.Coordinate}

Name Type Description
refElementOffset goog.math.Coordinate
refElementSize goog.math.Size
myElementSize goog.math.Size
Returns:
Type Description
goog.math.Coordinate

protectedpositionTopLeft(refElementOffset, refElementSize, myElementSize){goog.math.Coordinate}

Name Type Description
refElementOffset goog.math.Coordinate
refElementSize goog.math.Size
myElementSize goog.math.Size
Returns:
Type Description
goog.math.Coordinate

This function takes a string or an element to append into the content area of the tooltip.

Name Type Description
content string | Element

setRefElement(refElement)

Name Type Description
refElement Element

Reference element.

templates_base(){string}

This function returns the base of the tooltip as a string.

Returns:
Type Description
string

templates_loading(){string}

This function returns the content area of the tooltip as a string.

Returns:
Type Description
string

Unbind DOM event listeners of reference element.