goog.positioning
Namespacegoog.positioning.AbsolutePosition
ClassEncapsulates a popup position where the popup absolutely positioned by setting the left/top style elements directly to the specified values. The position is generally relative to the element's offsetParent. Normally, this is the document body, but can be another element if the popup element is scoped by an element with relative position. … more
goog.positioning.AbstractPosition
ClassAbstract position object. Encapsulates position and overflow handling. … more
goog.positioning.AnchoredPosition
ClassEncapsulates a popup position where the popup is anchored at a corner of an element. When using AnchoredPosition, it is recommended that the popup element specified in the Popup constructor or Popup.setElement be absolutely positioned. … more
goog.positioning.AnchoredViewportPosition
ClassEncapsulates a popup position where the popup is anchored at a corner of an element. The corners are swapped if dictated by the viewport. For instance if a popup is anchored with its top left corner to the bottom left corner of the anchor the popup is either displayed below the anchor (as specified) or above it if there's not enough room to display it below. When using this positioning object it's recommended that the movable element be absolutely positioned. … more
goog.positioning.ClientPosition
ClassEncapsulates a popup position where the popup is positioned relative to the window (client) coordinates. This calculates the correct position to use even if the element is relatively positioned to some other element. This is for trying to position an element at the spot of the mouse cursor in a MOUSEMOVE event. Just use the event.clientX and event.clientY as the parameters. … more
goog.positioning.Corner
EnumEnum for representing an element corner for positioning the popup. The START constants map to LEFT if element directionality is left to right and RIGHT if the directionality is right to left. Likewise END maps to RIGHT or LEFT depending on the directionality. … more
goog.positioning.CornerBit
EnumEnum for bits in the {@see goog.positioning.Corner) bitmap. … more
goog.positioning.MenuAnchoredPosition
ClassEncapsulates a popup position where the popup is anchored at a corner of an element. The positioning behavior changes based on the values of opt_adjust and opt_resize. When using this positioning object it's recommended that the movable element be absolutely positioned. … more
goog.positioning.Overflow
EnumEnum for representing position handling in cases where the element would be positioned outside the viewport. … more
goog.positioning.OverflowStatus
EnumEnum for representing the outcome of a positioning call. … more
goog.positioning.ViewportClientPosition
ClassEncapsulates a popup position where the popup is positioned relative to the window (client) coordinates, and made to stay within the viewport. … more
goog.positioning.ViewportPosition
ClassEncapsulates a popup position where the popup is positioned according to coordinates relative to the element's viewport (page). This calculates the correct position to use even if the element is relatively positioned to some other element. … more
.clientPositionTest
.flipCorner(corner)
Returns the corner opposite the given one horizontally and vertically.
corner
{goog.positioning.Corner
}
goog.positioning.Corner
}
.flipCornerHorizontal(corner)
Returns the corner opposite the given one horizontally.
corner
{goog.positioning.Corner
}
goog.positioning.Corner
}
.flipCornerVertical(corner)
Returns the corner opposite the given one vertically.
corner
{goog.positioning.Corner
}
goog.positioning.Corner
}
.getEffectiveCorner(element, 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.
element
{Element
}
corner
{goog.positioning.Corner
}
goog.positioning.Corner
}
.getOffsetParentPageOffset(movableElement)
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 {@code positionWithCoordinate}.
movableElement
{!Element
}
goog.math.Coordinate
}
.positionAtAnchor(anchorElement, anchorElementCorner, movableElement,
movableElementCorner, opt_offset, opt_margin, opt_overflow,
opt_preferredSize, opt_viewport)
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.
anchorElement
{Element
}
anchorElementCorner
{goog.positioning.Corner
}
movableElement
{Element
}
movableElementCorner
{goog.positioning.Corner
}
opt_offset
{goog.math.Coordinate
=}
opt_margin
{goog.math.Box
=}
opt_overflow
{?number
=}
opt_preferredSize
{goog.math.Size
=}
opt_viewport
{goog.math.Box
=}
goog.positioning.OverflowStatus
}
.positionAtCoordinate(absolutePos, movableElement, movableElementCorner, opt_margin,
opt_viewport, opt_overflow, opt_preferredSize)
Positions the specified corner of the movable element at the specified coordinate.
absolutePos
{goog.math.Coordinate
}
movableElement
{Element
}
movableElementCorner
{goog.positioning.Corner
}
opt_margin
{goog.math.Box
=}
opt_viewport
{goog.math.Box
=}
opt_overflow
{?number
=}
opt_preferredSize
{goog.math.Size
=}
goog.positioning.OverflowStatus
}