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