Fix #7978 - tidy up layout classes
[roojs1] / Roo / layout / South.js
1 Roo.layout.South = function(mgr, config){
2     Roo.layout.SplitRegion.call(this, mgr, config, "south", "s-resize");
3     if(this.split){
4         this.split.placement = Roo.SplitBar.BOTTOM;
5         this.split.orientation = Roo.SplitBar.VERTICAL;
6         this.split.el.addClass("x-layout-split-v");
7     }
8     var size = config.initialSize || config.height;
9     if(typeof size != "undefined"){
10         this.el.setHeight(size);
11     }
12 };
13 Roo.extend(Roo.layout.South, Roo.layout.SplitRegion, {
14     orientation: Roo.SplitBar.VERTICAL,
15     getBox : function(){
16         if(this.collapsed){
17             return this.collapsedEl.getBox();
18         }
19         var box = this.el.getBox();
20         if(this.split){
21             var sh = this.split.el.getHeight();
22             box.height += sh;
23             box.y -= sh;
24         }
25         return box;
26     },
27     
28     updateBox : function(box){
29         if(this.split && !this.collapsed){
30             var sh = this.split.el.getHeight();
31             box.height -= sh;
32             box.y += sh;
33             this.split.el.setLeft(box.x);
34             this.split.el.setTop(box.y-sh);
35             this.split.el.setWidth(box.width);
36         }
37         if(this.collapsed){
38             this.updateBody(box.width, null);
39         }
40         Roo.layout.Region.prototype.updateBox.call(this, box);
41     }
42 });