fc9fdf19c7b0c68a78a986360b93df20fdd82d00
[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(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     
30     getBox : function(){
31         if(this.collapsed){
32             return this.collapsedEl.getBox();
33         }
34         var box = this.el.getBox();
35         if(this.split){
36             box.height += this.split.el.getHeight();
37         }
38         return box;
39     },
40     
41     updateBox : function(box){
42         if(this.split && !this.collapsed){
43             box.height -= this.split.el.getHeight();
44             this.split.el.setLeft(box.x);
45             this.split.el.setTop(box.y+box.height);
46             this.split.el.setWidth(box.width);
47         }
48         if(this.collapsed){
49             this.updateBody(box.width, null);
50         }
51         Roo.bootstrap.layout.Region.prototype.updateBox.call(this, box);
52     }
53 });
54