]>
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 // dijit/layout/LayoutContainer
13 var LayoutContainer
= declare("dijit.layout.LayoutContainer", _LayoutWidget
, {
15 // Deprecated. Use `dijit/layout/BorderContainer` instead.
17 // Provides Delphi-style panel layout semantics.
19 // A LayoutContainer is a box with a specified size (like style="width: 500px; height: 500px;"),
20 // that contains children widgets marked with "layoutAlign" of "left", "right", "bottom", "top", and "client".
21 // It takes it's children marked as left/top/bottom/right, and lays them out along the edges of the box,
22 // and then it takes the child marked "client" and puts it into the remaining space in the middle.
24 // Left/right positioning is similar to CSS's "float: left" and "float: right",
25 // and top/bottom positioning would be similar to "float: top" and "float: bottom", if there were such
28 // Note that there can only be one client element, but there can be multiple left, right, top,
29 // or bottom elements.
31 // See `LayoutContainer.ChildWidgetProperties` for details on the properties that can be set on
32 // children of a `LayoutContainer`.
36 // | html, body{ height: 100%; width: 100%; }
38 // | <div data-dojo-type="dijit/layout/LayoutContainer" style="width: 100%; height: 100%">
39 // | <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="layoutAlign: 'top'">header text</div>
40 // | <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="layoutAlign: 'left'" style="width: 200px;">table of contents</div>
41 // | <div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="layoutAlign: 'client'">client area</div>
44 // Lays out each child in the natural order the children occur in.
45 // Basically each child is laid out into the "remaining space", where "remaining space" is initially
46 // the content area of this widget, but is reduced to a smaller rectangle each time a child is added.
50 baseClass
: "dijitLayoutContainer",
52 constructor: function(){
53 kernel
.deprecated("dijit.layout.LayoutContainer is deprecated", "use BorderContainer instead", 2.0);
57 layoutUtils
.layoutChildren(this.domNode
, this._contentBox
, this.getChildren());
60 addChild: function(/*dijit/_WidgetBase*/ child, /*Integer?*/ insertIndex
){
61 this.inherited(arguments
);
63 layoutUtils
.layoutChildren(this.domNode
, this._contentBox
, this.getChildren());
67 removeChild: function(/*dijit/_WidgetBase*/ widget){
68 this.inherited(arguments);
70 layoutUtils.layoutChildren(this.domNode, this._contentBox, this.getChildren());
75 LayoutContainer.ChildWidgetProperties = {
77 // This property can be specified for the children of a LayoutContainer.
79 // layoutAlign: String
80 // "none", "left", "right", "bottom", "top", and "client".
81 // See the LayoutContainer description for details on this parameter.
85 // Since any widget can be specified as a LayoutContainer child, mix it
86 // into the base widget class. (This is a hack, but it's effective.)
87 // This is for the benefit of the parser. Remove for 2.0. Also, hide from doc viewer.
88 lang.extend(_WidgetBase, /*===== {} || =====*/ LayoutContainer
.ChildWidgetProperties
);
90 return LayoutContainer
;