Roo/bootstrap/MessageBar.js
[roojs1] / Roo / bootstrap / MessageBar.js
1 /*
2  * - LGPL
3  *
4  * element
5  * 
6  */
7
8 /**
9  * @class Roo.bootstrap.MessageBar
10  * @extends Roo.bootstrap.Component
11  * Bootstrap MessageBar class
12  * @cfg {String} html contents of the MessageBar
13  * @cfg {String} weight (info | success | warning | danger) default info
14  * @cfg {Boolean} closable (true | false) default true
15  * 
16  * @constructor
17  * Create a new Element
18  * @param {Object} config The config object
19  */
20
21 Roo.bootstrap.MessageBar = function(config){
22     Roo.bootstrap.MessageBar.superclass.constructor.call(this, config);
23 };
24
25 Roo.extend(Roo.bootstrap.MessageBar, Roo.bootstrap.Component,  {
26     
27     html: '',
28     weight: 'info',
29     closable: true,
30     
31     getAutoCreate : function(){
32         
33         var cfg = {
34             tag: 'div',
35             cls: 'alert alert-dismissable alert-messages alert-' + this.weight,
36             html: this.html || ''
37         }
38         
39         if(this.closable){
40             cfg.cn = {
41                 tag: 'button',
42                 cls: 'close'
43             }
44         }
45         
46         return cfg;
47     }
48    
49 });
50
51  
52
53