Caplin Trader 4.5.2

Class: module:caplin/dom/PositionUtility

module:caplin/dom/PositionUtility

Constructor

new module:caplin/dom/PositionUtility()

Methods

(static) positionElement(element, target, boundaryElementopt)

Positions an element relative to a target element.

The position strategy used is as follows:

If adequate space is available, the element is positioned so the top left corner of the element is adjacent to the bottom left corner of the target.

If there is inadequate vertical space, the element is positioned so that the bottom left corner is adjacent to the top left corner of the target.

If there is inadequate horizontal space, the element is shifted left to fit.

Parameters:
Name Type Attributes Description
element HTMLElement The element to position.
target HTMLElement Position relative to this element.
boundaryElement HTMLElement <optional>
Position to fit within this element.