X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=docs%2Fsrc%2FRoo_bootstrap_ProgressBar.js.html;fp=docs%2Fsrc%2FRoo_bootstrap_ProgressBar.js.html;h=0485bef1dd9c17fc2121ff1dc4c69705899cf616;hb=9ff8ded6bbbd258ecd646184ba26020874e2c085;hp=0000000000000000000000000000000000000000;hpb=2542b67d1a0768025056f2f330bfe50b64d1ad38;p=roojs1 diff --git a/docs/src/Roo_bootstrap_ProgressBar.js.html b/docs/src/Roo_bootstrap_ProgressBar.js.html new file mode 100644 index 0000000000..0485bef1dd --- /dev/null +++ b/docs/src/Roo_bootstrap_ProgressBar.js.html @@ -0,0 +1,95 @@ +/home/alan/gitlive/roojs1/Roo/bootstrap/ProgressBar.js/* + * - LGPL + * + * ProgressBar + * + */ + +/** + * @class Roo.bootstrap.ProgressBar + * @extends Roo.bootstrap.Component + * Bootstrap ProgressBar class + * @cfg {Number} aria_valuenow aria-value now + * @cfg {Number} aria_valuemin aria-value min + * @cfg {Number} aria_valuemax aria-value max + * @cfg {String} label label for the progress bar + * @cfg {String} panel (success | info | warning | danger ) + * @cfg {String} role role of the progress bar + * @cfg {String} sr_only text + * + * + * @constructor + * Create a new ProgressBar + * @param {Object} config The config object + */ + +Roo.bootstrap.ProgressBar = function(config){ + Roo.bootstrap.ProgressBar.superclass.constructor.call(this, config); +}; + +Roo.extend(Roo.bootstrap.ProgressBar, Roo.bootstrap.Component, { + + aria_valuenow : 0, + aria_valuemin : 0, + aria_valuemax : 100, + label : false, + panel : false, + role : false, + sr_only: false, + + getAutoCreate : function() + { + + var cfg = { + tag: 'div', + cls: 'progress-bar', + style: 'width:' + Math.ceil((this.aria_valuenow / this.aria_valuemax) * 100) + '%' + }; + + if(this.sr_only){ + cfg.cn = { + tag: 'span', + cls: 'sr-only', + html: this.sr_only + } + } + + if(this.role){ + cfg.role = this.role; + } + + if(this.aria_valuenow){ + cfg['aria-valuenow'] = this.aria_valuenow; + } + + if(this.aria_valuemin){ + cfg['aria-valuemin'] = this.aria_valuemin; + } + + if(this.aria_valuemax){ + cfg['aria-valuemax'] = this.aria_valuemax; + } + + if(this.label && !this.sr_only){ + cfg.html = this.label; + } + + if(this.panel){ + cfg.cls += ' progress-bar-' + this.panel; + } + + return cfg; + }, + + update : function(aria_valuenow) + { + this.aria_valuenow = aria_valuenow; + + this.el.setStyle('width', Math.ceil((this.aria_valuenow / this.aria_valuemax) * 100) + '%'); + } + +}); + + + + \ No newline at end of file