positioning.js
No description.

File Location

/goog/positioning/positioning.js


Public Protected Private

Enumerations

Global Functions

goog.positioning.adjustForViewport_(possizeviewportoverflow) goog.positioning.OverflowStatus
Adjusts the position and/or size of an element, identified by its position and size, to fit inside the viewport. If the position or size of the element is adjusted the pos or size objects, respectively, are modified.
Arguments:
pos : goog.math.Coordinate
Position of element, updated if the position is adjusted.
size : goog.math.Size
Size of element, updated if the size is adjusted.
viewport : goog.math.Box
Bounding box describing the viewport.
overflow : number
Overflow handling mode, .
Returns: goog.positioning.OverflowStatus  Status bitmap, .
code »
goog.positioning.flipCorner(corner) goog.positioning.Corner
Returns the corner opposite the given one horizontally and vertically.
Arguments:
corner : goog.positioning.Corner
The popup corner used to flip.
Returns: goog.positioning.Corner  The opposite corner horizontally and vertically.
code »
goog.positioning.flipCornerHorizontal(corner) goog.positioning.Corner
Returns the corner opposite the given one horizontally.
Arguments:
corner : goog.positioning.Corner
The popup corner used to flip.
Returns: goog.positioning.Corner  The opposite corner horizontally.
code »
goog.positioning.flipCornerVertical(corner) goog.positioning.Corner
Returns the corner opposite the given one vertically.
Arguments:
corner : goog.positioning.Corner
The popup corner used to flip.
Returns: goog.positioning.Corner  The opposite corner vertically.
code »
goog.positioning.getEffectiveCorner(elementcorner) goog.positioning.Corner
Returns an absolute corner (top/bottom left/right) given an absolute or relative (top/bottom start/end) corner and the direction of an element. Absolute corners remain unchanged.
Arguments:
element : Element
DOM element to test for RTL direction.
corner : goog.positioning.Corner
The popup corner used for positioning.
Returns: goog.positioning.Corner  Effective corner.
code »
goog.positioning.getOffsetParentPageOffset(movableElement) !goog.math.Coordinate
Calculates the page offset of the given element's offsetParent. This value can be used to translate any x- and y-offset relative to the page to an offset relative to the offsetParent, which can then be used directly with as position coordinate for positionWithCoordinate.
Arguments:
movableElement : !Element
The element to calculate.
Returns: !goog.math.Coordinate  The page offset, may be (0, 0).
code »
goog.positioning.getVisiblePart_(el) !goog.math.Rect
Returns intersection of the specified element and goog.style.getVisibleRectForElement for it.
Arguments:
el : Element
The target element.
Returns: !goog.math.Rect  Intersection of getVisibleRectForElement and the current bounding rectangle of the element. If the intersection is empty, returns the bounding rectangle.
code »
goog.positioning.positionAtAnchor(anchorElementanchorElementCornermovableElementmovableElementCorneropt_offsetopt_marginopt_overflowopt_preferredSizeopt_viewport) goog.positioning.OverflowStatus
Positions a movable element relative to an anchor element. The caller specifies the corners that should touch. This functions then moves the movable element accordingly.
Arguments:
anchorElement : Element
The element that is the anchor for where the movable element should position itself.
anchorElementCorner : goog.positioning.Corner
The corner of the anchorElement for positioning the movable element.
movableElement : Element
The element to move.
movableElementCorner : goog.positioning.Corner
The corner of the movableElement that that should be positioned adjacent to the anchor element.
opt_offset : goog.math.Coordinate=
An offset specified in pixels. After the normal positioning algorithm is applied, the offset is then applied. Positive coordinates move the popup closer to the center of the anchor element. Negative coordinates move the popup away from the center of the anchor element.
opt_margin : goog.math.Box=
A margin specified in pixels. After the normal positioning algorithm is applied and any offset, the margin is then applied. Positive coordinates move the popup away from the spot it was positioned towards its center. Negative coordinates move it towards the spot it was positioned away from its center.
opt_overflow : ?number=
Overflow handling mode. Defaults to IGNORE if not specified. Bitmap, .
opt_preferredSize : goog.math.Size=
The preferred size of the movableElement.
opt_viewport : goog.math.Box=
Box object describing the dimensions of the viewport. The viewport is specified relative to offsetParent of movableElement. In other words, the viewport can be thought of as describing a "position: absolute" element contained in the offsetParent. It defaults to visible area of nearest scrollable ancestor of movableElement (see goog.style.getVisibleRectForElement).
Returns: goog.positioning.OverflowStatus  Status bitmap, .
code »
goog.positioning.positionAtCoordinate(absolutePosmovableElementmovableElementCorneropt_marginopt_viewportopt_overflowopt_preferredSize) goog.positioning.OverflowStatus
Positions the specified corner of the movable element at the specified coordinate.
Arguments:
absolutePos : goog.math.Coordinate
The coordinate to position the element at.
movableElement : Element
The element to be positioned.
movableElementCorner : goog.positioning.Corner
The corner of the movableElement that that should be positioned.
opt_margin : goog.math.Box=
A margin specified in pixels. After the normal positioning algorithm is applied and any offset, the margin is then applied. Positive coordinates move the popup away from the spot it was positioned towards its center. Negative coordinates move it towards the spot it was positioned away from its center.
opt_viewport : goog.math.Box=
Box object describing the dimensions of the viewport. Required if opt_overflow is specified.
opt_overflow : ?number=
Overflow handling mode. Defaults to IGNORE if not specified, .
opt_preferredSize : goog.math.Size=
The preferred size of the movableElement. Defaults to the current size.
Returns: goog.positioning.OverflowStatus  Status bitmap.
code »

Directory positioning

File Reference