]>
git.wh0rd.org - tt-rss.git/blob - lib/dijit/layout/LayoutContainer.js.uncompressed.js
1 define("dijit/layout/LayoutContainer", [
2 "dojo/_base/kernel", // kernel.deprecated
4 "dojo/_base/declare", // declare
7 "./utils" // layoutUtils.layoutChildren
8 ], function(kernel
, lang
, declare
, _WidgetBase
, _LayoutWidget
, layoutUtils
){
11 var _WidgetBase = dijit._WidgetBase;
12 var _LayoutWidget = dijit.layout._LayoutWidget;
16 // dijit/layout/LayoutContainer
18 // Deprecated. Use `dijit.layout.BorderContainer` instead.
21 // This argument can be specified for the children of a LayoutContainer.
22 // Since any widget can be specified as a LayoutContainer child, mix it
23 // into the base widget class. (This is a hack, but it's effective.)
24 lang
.extend(_WidgetBase
, {
25 // layoutAlign: String
26 // "none", "left", "right", "bottom", "top", and "client".
27 // See the LayoutContainer description for details on this parameter.
31 return declare("dijit.layout.LayoutContainer", _LayoutWidget
, {
33 // Deprecated. Use `dijit.layout.BorderContainer` instead.
36 // Provides Delphi-style panel layout semantics.
38 // A LayoutContainer is a box with a specified size (like style="width: 500px; height: 500px;"),
39 // that contains children widgets marked with "layoutAlign" of "left", "right", "bottom", "top", and "client".
40 // It takes it's children marked as left/top/bottom/right, and lays them out along the edges of the box,
41 // and then it takes the child marked "client" and puts it into the remaining space in the middle.
43 // Left/right positioning is similar to CSS's "float: left" and "float: right",
44 // and top/bottom positioning would be similar to "float: top" and "float: bottom", if there were such
47 // Note that there can only be one client element, but there can be multiple left, right, top,
48 // or bottom elements.
52 // | html, body{ height: 100%; width: 100%; }
54 // | <div data-dojo-type="dijit.layout.LayoutContainer" style="width: 100%; height: 100%">
55 // | <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="layoutAlign: 'top'">header text</div>
56 // | <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="layoutAlign: 'left'" style="width: 200px;">table of contents</div>
57 // | <div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="layoutAlign: 'client'">client area</div>
60 // Lays out each child in the natural order the children occur in.
61 // Basically each child is laid out into the "remaining space", where "remaining space" is initially
62 // the content area of this widget, but is reduced to a smaller rectangle each time a child is added.
66 baseClass
: "dijitLayoutContainer",
68 constructor: function(){
69 kernel
.deprecated("dijit.layout.LayoutContainer is deprecated", "use BorderContainer instead", 2.0);
73 layoutUtils
.layoutChildren(this.domNode
, this._contentBox
, this.getChildren());
76 addChild: function(/*dijit._Widget*/ child
, /*Integer?*/ insertIndex
){
77 this.inherited(arguments
);
79 layoutUtils
.layoutChildren(this.domNode
, this._contentBox
, this.getChildren());
83 removeChild: function(/*dijit._Widget*/ widget
){
84 this.inherited(arguments
);
86 layoutUtils
.layoutChildren(this.domNode
, this._contentBox
, this.getChildren());