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