Roo/bootstrap/ButtonGroup.js
[roojs1] / Roo / bootstrap / ButtonGroup.js
1 /*
2  * - LGPL
3  *
4  * page contgainer.
5  * 
6  */ 
7 Roo.bootstrap.ButtonGroup = function(config){
8     Roo.bootstrap.ButtonGroup.superclass.constructor.call(this, config);
9 };
10
11 Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component,  {
12     
13     size: '',
14     align: '',
15     dropdirection: '',
16     
17     autoCreate : {
18         cls: 'btn-group',
19         html : null
20     },
21
22     getAutoCreate : function(){
23         
24         var cfg = Roo.apply({}, Roo.bootstrap.ButtonGroup.superclass.getAutoCreate.call(this));
25         
26         cfg.html = this.html || cfg.html;
27         
28         if (['vertical','justified'].indexOf(this.align)!==-1) {
29             cfg.cls = 'btn-group-' + this.align;
30             
31             if (this.align == 'justified') {
32                 console.log(this.items)
33             }
34         }
35         
36         if (['lg','sm','xs'].indexOf(this.size)!==-1) {
37             cfg.cls += ' btn-group-' + this.size;
38         }
39         
40         if (['dropup'].indexOf(this.dropdirection)) {
41             cfg.cls += ' dropup';
42         }
43         
44         return cfg;
45     }
46    
47 });
48
49