Roo/bootstrap/ButtonGroup.js
[roojs1] / Roo / bootstrap / ButtonGroup.js
1 /*
2  * - LGPL
3  *
4  * page contgainer.
5  * 
6  */
7
8
9 /**
10  * @class Roo.bootstrap.ButtonGroup
11  * @extends Roo.bootstrap.Component
12  * Bootstrap ButtonGroup class
13  * @cfg {string} size lg | sm | xs (default empty normal)
14  * @cfg {string} align vertical | justified  (default none)
15  * @cfg {string} dropdirection up | down (default down)
16  * 
17  * 
18  * @constructor
19  * Create a new Input
20  * @param {Object} config The config object
21  */
22
23 Roo.bootstrap.ButtonGroup = function(config){
24     Roo.bootstrap.ButtonGroup.superclass.constructor.call(this, config);
25 };
26
27 Roo.extend(Roo.bootstrap.ButtonGroup, Roo.bootstrap.Component,  {
28     
29     size: '',
30     align: '',
31      direction: '',
32     
33     autoCreate : {
34         cls: 'btn-group',
35         html : null
36     },
37
38     getAutoCreate : function(){
39         
40         var cfg = Roo.apply({}, Roo.bootstrap.ButtonGroup.superclass.getAutoCreate.call(this));
41         
42         cfg.html = this.html || cfg.html;
43         
44         if (['vertical','justified'].indexOf(this.align)!==-1) {
45             cfg.cls = 'btn-group-' + this.align;
46             
47             if (this.align == 'justified') {
48                 console.log(this.items);
49             }
50         }
51         
52         if (['lg','sm','xs'].indexOf(this.size)!==-1) {
53             cfg.cls += ' btn-group-' + this.size;
54         }
55         
56         if (this.direction == 'up') {
57             cfg.cls += ' dropup' ;
58         }
59         
60         return cfg;
61     }
62    
63 });
64
65