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