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