Roo/bootstrap/Progress.js
[roojs1] / Roo / bootstrap / Progress.js
1 /*
2  * - LGPL
3  *
4  * Progress
5  * 
6  */
7
8 /**
9  * @class Roo.bootstrap.Progress
10  * @extends Roo.bootstrap.Component
11  * Bootstrap Progress class
12  * @cfg {Number} aria_valuenow aria-value now
13  * @cfg {Number} aria_valuemin aria-value min
14  * @cfg {Number} aria_valuemax aria-value max
15  * @cfg {String} label label for the progress bar
16  * @cfg {String} panel (success | info | warning | danger )
17  * @cfg {String} role role of the progress bar
18  * @cfg {Boolean} striped striped of the progress bar
19  * @cfg {Boolean} active animated of the progress bar
20  * @cfg {String} sr_only text
21  * 
22  * 
23  * @constructor
24  * Create a new Progress
25  * @param {Object} config The config object
26  */
27
28 Roo.bootstrap.Progress = function(config){
29     Roo.bootstrap.Progress.superclass.constructor.call(this, config);
30 };
31
32 Roo.extend(Roo.bootstrap.Progress, Roo.bootstrap.Component,  {
33     
34     aria_valuenow : false,
35     aria_valuemin : 0,
36     aria_valuemax : 100,
37     label : false,
38     panel : false,
39     role : false,
40     striped : false,
41     active: false,
42     
43     getAutoCreate : function(){
44         var cfg = {
45             tag: 'div',
46             cls: 'progress',
47             cn: [
48                 {
49                     tag: 'div',
50                     cls: 'progress-bar'
51                 }
52             ]
53         };
54         
55         if(this.striped){
56             cfg.cls += ' progress-striped';
57         }
58       
59         if(this.active){
60             cfg.cls += ' active';
61         }
62         
63         if(this.role){
64             cfg.cn[0].role = this.role;
65         }
66         
67         if(this.aria_valuenow){
68             cfg.cn[0]['aria-valuenow'] = this.aria_valuenow;
69         }
70         
71         if(this.label){
72             cfg.cn[0].html = this.label;
73         }
74         
75         if(this.panel){
76             cfg.cn[0].cls += ' progress-bar-' + this.panel;
77         }
78         
79         return cfg;
80     }
81    
82 });
83
84  
85
86