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