function (/*DomNode*/ container, /*Object*/ dim, children) (view source)
// copy dim because we are going to modify it
dim = dojo.mixin({}, dim);
dojo.addClass(container, "dijitLayoutContainer");
// Move "client" elements to the end of the array for layout. a11y dictates that the author// needs to be able to put them in the document in tab-order, but this algorithm requires that// client be last.
children = dojo.filter(children, function(item){returnitem.layoutAlign!= "client"; })
.concat(dojo.filter(children, function(item){returnitem.layoutAlign == "client"; }));
// set positions/sizes
dojo.forEach(children, function(child){var elm = child.domNode,
pos = child.layoutAlign;
// set elem to upper left corner of unused space; may move it latervar elmStyle = elm.style;
elmStyle.left = dim.l+"px";
elmStyle.top = dim.t+"px";
elmStyle.bottom = elmStyle.right = "auto";
dojo.addClass(elm, "dijitAlign" + capitalize(pos));
// set size && adjust record of remaining space.// note that setting the width of a <div> may affect it's height.if(pos=="top"|| pos=="bottom"){
size(child, { w: dim.w});
dim.h -= child.h;
if(pos=="top"){
dim.t += child.h;
}else{
elmStyle.top = dim.t + dim.h + "px";
}}elseif(pos=="left"|| pos=="right"){
size(child, { h: dim.h});
dim.w -= child.w;
if(pos=="left"){
dim.l += child.w;
}else{
elmStyle.left = dim.l + dim.w + "px";
}}elseif(pos=="client"){
size(child, dim);
}});