fix layout height calc
[roojs1] / Roo / bootstrap / layout / South.js
1
2
3
4
5 Roo.bootstrap.layout.South = function(config){
6     config.region = 'south';
7     config.cursor = 's-resize';
8     Roo.bootstrap.layout.Split.call(this, config);
9     if(this.split){
10         this.split.placement = Roo.bootstrap.SplitBar.BOTTOM;
11         this.split.orientation = Roo.bootstrap.SplitBar.VERTICAL;
12         this.split.el.addClass("roo-layout-split-v");
13     }
14     
15 };
16
17 Roo.extend(Roo.bootstrap.layout.South, Roo.bootstrap.layout.Split, {
18     orientation: Roo.bootstrap.SplitBar.VERTICAL,
19     
20     onRender : function(ctr, pos)
21     {
22         Roo.bootstrap.layout.Split.prototype.onRender.call(this, ctr, pos);
23         var size = this.config.initialSize || this.config.height;
24         if(this.el && typeof size != "undefined"){
25             this.el.setHeight(size);
26         }
27     
28     },
29     
30     getBox : function(){
31         if(this.collapsed){
32             return this.collapsedEl.getBox();
33         }
34         var box = this.el.getBox();
35         if(this.split){
36             var sh = this.split.el.getHeight();
37             box.height += sh;
38             box.y -= sh;
39         }
40         return box;
41     },
42     
43     updateBox : function(box){
44         if(this.split && !this.collapsed){
45             var sh = this.split.el.getHeight();
46             box.height -= sh;
47             box.y += sh;
48             this.split.el.setLeft(box.x);
49             this.split.el.setTop(box.y-sh);
50             this.split.el.setWidth(box.width);
51         }
52         if(this.collapsed){
53             this.updateBody(box.width, null);
54         }
55         Roo.bootstrap.layout.Region.prototype.updateBox.call(this, box);
56     }
57 });