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