// summary// Like placeOnScreen, except it accepts aroundNode instead of x,y// and attempts to place node around it. Uses margin box dimensions.//// aroundCorners// specify Which corner of aroundNode should be// used to place the node => which corner(s) of node to use (see the// corners parameter in dijit.placeOnScreen)// e.g. {'TL': 'BL', 'BL': 'TL'}//// layoutNode: Function(node, aroundNodeCorner, nodeCorner)// 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.// get coordinates of aroundNode
aroundNode = dojo.byId(aroundNode);
var oldDisplay = aroundNode.style.display;
aroundNode.style.display="";
// #3172: use the slightly tighter border box instead of marginBoxvar aroundNodeW = aroundNode.offsetWidth; //mb.w;var aroundNodeH = aroundNode.offsetHeight; //mb.h;var aroundNodePos = dojo.coords(aroundNode, true);
aroundNode.style.display=oldDisplay;
// Generate list of possible positions for nodevar choices = [];
for(var nodeCorner in aroundCorners){
choices.push({
aroundCorner: nodeCorner,
corner: aroundCorners[nodeCorner],
pos: {
x: aroundNodePos.x + (nodeCorner.charAt(1) == 'L' ? 0 : aroundNodeW),
y: aroundNodePos.y + (nodeCorner.charAt(0) == 'T' ? 0 : aroundNodeH)}});
}returndijit._place(node, choices, layoutNode);