dijit/_base/place (version 1.10)

Summary

Deprecated back compatibility module, new code should use dijit/place directly instead of using this module.

See the dijit/_base/place reference documentation for more information.

Method Summary

  • getPopupAroundAlignment(position,leftToRight) Deprecated method, unneeded when using dijit/place directly.
  • getViewport() Deprecated method to return the dimensions and scroll position of the viewable area of a browser window.
  • placeOnScreen(node,pos,corners,padding,layoutNode) Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of padding.x 2 and padding.y 2, or zero if padding not specified.
  • placeOnScreenAroundElement(node,aroundNode,aroundCorners,layoutNode) Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object for the "around" argument and finds a proper processor to place a node.
  • placeOnScreenAroundNode(node,aroundNode,aroundCorners,layoutNode) Position node adjacent or kitty-corner to aroundNode such that it's fully visible in viewport.
  • placeOnScreenAroundRectangle(node,aroundRect,aroundCorners,layoutNode) Like dijit.placeOnScreenAroundNode(), except that the "around" parameter is an arbitrary rectangle on the screen (x, y, width, height) instead of a dom node.

Methods

getPopupAroundAlignment(position,leftToRight)
Defined by dijit/_base/place

Deprecated method, unneeded when using dijit/place directly. Transforms the passed array of preferred positions into a format suitable for passing as the aroundCorners argument to dijit/place.placeOnScreenAroundElement.

Parameter Type Description
position String[]

This variable controls the position of the drop down. It's an array of strings with the following values:

  • before: places drop down to the left of the target node/widget, or to the right in the case of RTL scripts like Hebrew and Arabic
  • after: places drop down to the right of the target node/widget, or to the left in the case of RTL scripts like Hebrew and Arabic
  • above: drop down goes above target node
  • below: drop down goes below target node

The list is positions is tried, in order, until a position is found where the drop down fits within the viewport.

leftToRight Boolean

Whether the popup will be displaying in leftToRight mode.

getViewport()
Defined by dijit/_base/place

Deprecated method to return the dimensions and scroll position of the viewable area of a browser window. New code should use windowUtils.getBox()

placeOnScreen(node,pos,corners,padding,layoutNode)
Defined by dijit/place

Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of padding.x 2 and padding.y 2, or zero if padding not specified. Picks first corner in corners[] where node is fully visible, or the corner where it's most visible.

Node is assumed to be absolutely or relatively positioned.

Parameter Type Description
node DOMNode

The node to position

pos dijit/place.__Position

Object like {x: 10, y: 20}

corners String[]

Array of Strings representing order to try corners of the node in, like ["TR", "BL"]. Possible values are:

  • "BL" - bottom left
  • "BR" - bottom right
  • "TL" - top left
  • "TR" - top right
padding dijit/place.__Position
Optional

Optional param to set padding, to put some buffer around the element you want to position. Defaults to zero.

layoutNode undefined

For things like tooltip, they are displayed differently (and have different dimensions) based on their orientation relative to the parent. This adjusts the popup based on orientation.

Returns:undefined

Examples

Example 1

Try to place node's top right corner at (10,20). If that makes node go (partially) off screen, then try placing bottom left corner at (10,20).

place(node, {x: 10, y: 20}, ["TR", "BL"])
placeOnScreenAroundElement(node,aroundNode,aroundCorners,layoutNode)
Defined by dijit/_base/place

Like dijit.placeOnScreenAroundNode(), except it accepts an arbitrary object for the "around" argument and finds a proper processor to place a node. Deprecated, new code should use dijit/place.around() instead.

Parameter Type Description
node undefined
aroundNode undefined
aroundCorners undefined
layoutNode undefined
placeOnScreenAroundNode(node,aroundNode,aroundCorners,layoutNode)
Defined by dijit/_base/place

Position node adjacent or kitty-corner to aroundNode such that it's fully visible in viewport. Deprecated, new code should use dijit/place.around() instead.

Parameter Type Description
node undefined
aroundNode undefined
aroundCorners undefined
layoutNode undefined
placeOnScreenAroundRectangle(node,aroundRect,aroundCorners,layoutNode)
Defined by dijit/_base/place

Like dijit.placeOnScreenAroundNode(), except that the "around" parameter is an arbitrary rectangle on the screen (x, y, width, height) instead of a dom node. Deprecated, new code should use dijit/place.around() instead.

Parameter Type Description
node undefined
aroundRect undefined
aroundCorners undefined
layoutNode undefined
Error in the documentation? Can’t find what you are looking for? Let us know!