positioning.MenuAnchoredPosition Extends goog.positioning.AnchoredViewportPosition
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.

Inheritance

Constructor

goog.positioning.MenuAnchoredPosition(anchorElementcorneropt_adjustopt_resize)

Parameters

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.

Instance Methods

Public Protected Private
adjustCorner(statuscorner) goog.positioning.Corner
Adjusts the corner if X or Y positioning failed.
Arguments:
status : number
The status of the last positionAtAnchor call.
corner : goog.positioning.Corner
The corner to adjust.
Returns: goog.positioning.Corner  The adjusted corner.
code »
getLastResortOverflow() number
No description.
Returns: number  A bitmask for the "last resort" overflow.
code »
getOverflowConstraint() goog.math.Box | undefined
No description.
Returns: goog.math.Box | undefined  The box object describing the dimensions in which the movable element will be shown.
code »
reposition(movableElementmovableCorneropt_marginopt_preferredSize)
Repositions the movable element.
Arguments:
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.
code »
setLastResortOverflow(lastResortOverflow)
No description.
Arguments:
lastResortOverflow : number
A bitmask for the "last resort" overflow, if we fail to fit the element on-screen.
code »
setOverflowConstraint(overflowConstraint)
No description.
Arguments:
overflowConstraint : goog.math.Box | undefined
Box object describing the dimensions in which the movable element could be shown.
code »
reposition(movableElementmovableCorneropt_marginopt_preferredSize)
Repositions the movable element.
Arguments:
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 specifin pixels.
opt_preferredSize : goog.math.Size=
PreferredSize of the movableElement (unused in this class).
code »
reposition(movableElementcorneropt_marginopt_preferredSize)
Repositions the element. Abstract method, should be overloaded.
Arguments:
movableElement : Element
Element to position.
corner : 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=
PreferredSize of the movableElement.
code »

Instance Properties

constructor :
No description.
Code »
constructor :
No description.
Code »
lastResortOverflow_ :
The last resort algorithm to use if the algorithm can't fit inside the viewport. IGNORE = do nothing, just display at the preferred position. ADJUST_X | ADJUST_Y = Adjust until the element fits, even if that means that the anchored corners are ignored.
Code »
overflowConstraint_ : goog.math.Box
The dimensions in which the movable element could be shown.
Code »
constructor :
No description.
Code »
corner :
Corner of anchored element the movable element should be positioned at.
Code »
element :
Element the movable element should be anchored against.
Code »
overflow_ :
Overflow handling mode. Defaults to IGNORE if not specified. Bitmap, .
Code »

Static Properties

goog.positioning.MenuAnchoredPosition.superClass_ :
No description.
Code »

Package positioning

Package Reference