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