The goog.positioning.MenuAnchoredPosition Class

goog.positioning.MenuAnchoredPosition
> goog.positioning.AnchoredViewportPosition
> goog.positioning.AnchoredPosition
> goog.positioning.AbstractPosition

Encapsulates 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.

anchorElement {Element}
Element the movable element should be anchored against.
corner {goog.positioning.Corner}
Corner of anchored element the movable element should be positioned at.
opt_adjust {boolean=}
Whether the positioning should be adjusted until the element fits inside the viewport even if that means that the anchored corners are ignored.
opt_resize {boolean=}
Whether the positioning should be adjusted until the element fits inside the viewport on the X axis and its height is resized so if fits in the viewport. This take precedence over opt_adjust.

.getLastResortOverflow()

Inherited from goog.positioning.AnchoredViewportPosition .

returns {number}
A bitmask for the "last resort" overflow.

.reposition(movableElement, movableCorner, opt_margin, opt_preferredSize)

Inherited from goog.positioning.AnchoredViewportPosition .

Repositions the movable element.

movableElement {Element}
Element to position.
movableCorner {goog.positioning.Corner}
Corner of the movable element that should be positioned adjacent to the anchored element.
opt_margin {goog.math.Box=}
A margin specified in pixels.
opt_preferredSize {goog.math.Size=}
The preferred size of the movableElement.

.setLastResortOverflow(lastResortOverflow)

Inherited from goog.positioning.AnchoredViewportPosition .

lastResortOverflow {number}
A bitmask for the "last resort" overflow, if we fail to fit the element on-screen.