4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
12 * These classes are private internal classes
14 Roo.bootstrap.layout.Center = function(config){
15 config.region = "center";
16 Roo.bootstrap.layout.Region.call(this, config);
18 this.minWidth = config.minWidth || 20;
19 this.minHeight = config.minHeight || 20;
22 Roo.extend(Roo.bootstrap.layout.Center, Roo.bootstrap.layout.Region, {
24 // center panel can't be hidden
28 // center panel can't be hidden
31 getMinWidth: function(){
35 getMinHeight: function(){
36 return this.minHeight;
49 Roo.bootstrap.layout.North = function(config)
51 config.region = 'north';
52 config.cursor = 'n-resize';
54 Roo.bootstrap.layout.Split.call(this, config);
58 this.split.placement = Roo.bootstrap.SplitBar.TOP;
59 this.split.orientation = Roo.bootstrap.SplitBar.VERTICAL;
60 this.split.el.addClass("roo-layout-split-v");
62 var size = config.initialSize || config.height;
63 if(typeof size != "undefined"){
64 this.el.setHeight(size);
67 Roo.extend(Roo.bootstrap.layout.North, Roo.bootstrap.layout.Split,
69 orientation: Roo.bootstrap.SplitBar.VERTICAL,
75 return this.collapsedEl.getBox();
77 var box = this.el.getBox();
79 box.height += this.split.el.getHeight();
84 updateBox : function(box){
85 if(this.split && !this.collapsed){
86 box.height -= this.split.el.getHeight();
87 this.split.el.setLeft(box.x);
88 this.split.el.setTop(box.y+box.height);
89 this.split.el.setWidth(box.width);
92 this.updateBody(box.width, null);
94 Roo.bootstrap.layout.Region.prototype.updateBox.call(this, box);
102 Roo.bootstrap.layout.South = function(config){
103 config.region = 'south';
104 config.cursor = 's-resize';
105 Roo.bootstrap.layout.Split.call(this, config);
107 this.split.placement = Roo.bootstrap.SplitBar.BOTTOM;
108 this.split.orientation = Roo.bootstrap.SplitBar.VERTICAL;
109 this.split.el.addClass("roo-layout-split-v");
111 var size = config.initialSize || config.height;
112 if(typeof size != "undefined"){
113 this.el.setHeight(size);
117 Roo.extend(Roo.bootstrap.layout.South, Roo.bootstrap.layout.Split, {
118 orientation: Roo.bootstrap.SplitBar.VERTICAL,
121 return this.collapsedEl.getBox();
123 var box = this.el.getBox();
125 var sh = this.split.el.getHeight();
132 updateBox : function(box){
133 if(this.split && !this.collapsed){
134 var sh = this.split.el.getHeight();
137 this.split.el.setLeft(box.x);
138 this.split.el.setTop(box.y-sh);
139 this.split.el.setWidth(box.width);
142 this.updateBody(box.width, null);
144 Roo.bootstrap.layout.Region.prototype.updateBox.call(this, box);
148 Roo.bootstrap.layout.East = function(config){
149 config.region = "east";
150 config.cursor = "e-resize";
151 Roo.bootstrap.layout.Split.call(this, config);
153 this.split.placement = Roo.bootstrap.SplitBar.RIGHT;
154 this.split.orientation = Roo.bootstrap.SplitBar.HORIZONTAL;
155 this.split.el.addClass("roo-layout-split-h");
157 var size = config.initialSize || config.width;
158 if(typeof size != "undefined"){
159 this.el.setWidth(size);
162 Roo.extend(Roo.bootstrap.layout.East, Roo.bootstrap.layout.Split, {
163 orientation: Roo.bootstrap.SplitBar.HORIZONTAL,
166 return this.collapsedEl.getBox();
168 var box = this.el.getBox();
170 var sw = this.split.el.getWidth();
177 updateBox : function(box){
178 if(this.split && !this.collapsed){
179 var sw = this.split.el.getWidth();
181 this.split.el.setLeft(box.x);
182 this.split.el.setTop(box.y);
183 this.split.el.setHeight(box.height);
187 this.updateBody(null, box.height);
189 Roo.bootstrap.layout.Region.prototype.updateBox.call(this, box);
193 Roo.bootstrap.layout.West = function(config){
194 config.region = "west";
195 config.cursor = "w-resize";
197 Roo.bootstrap.layout.Split.call(this, config);
199 this.split.placement = Roo.bootstrap.SplitBar.LEFT;
200 this.split.orientation = Roo.bootstrap.SplitBar.HORIZONTAL;
201 this.split.el.addClass("roo-layout-split-h");
205 Roo.extend(Roo.bootstrap.layout.West, Roo.bootstrap.layout.Split, {
206 orientation: Roo.bootstrap.SplitBar.HORIZONTAL,
208 onRender: function(ctr, pos)
210 Roo.bootstrap.layout.West.superclass.onRender.call(this, ctr,pos);
211 var size = this.config.initialSize || this.config.width;
212 if(typeof size != "undefined"){
213 this.el.setWidth(size);
219 return this.collapsedEl.getBox();
221 var box = this.el.getBox();
223 box.width += this.split.el.getWidth();
228 updateBox : function(box){
229 if(this.split && !this.collapsed){
230 var sw = this.split.el.getWidth();
232 this.split.el.setLeft(box.x+box.width);
233 this.split.el.setTop(box.y);
234 this.split.el.setHeight(box.height);
237 this.updateBody(null, box.height);
239 Roo.bootstrap.layout.Region.prototype.updateBox.call(this, box);