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 * @cfg {Boolean} fixed (true | false) default false, fix the bar at the top
18 * Create a new Element
19 * @param {Object} config The config object
22 Roo.bootstrap.MessageBar = function(config){
23 Roo.bootstrap.MessageBar.superclass.constructor.call(this, config);
26 Roo.extend(Roo.bootstrap.MessageBar, Roo.bootstrap.Component, {
33 getAutoCreate : function(){
37 cls: 'alert alert-dismissable alert-' + this.weight,
48 cfg.cls += ' alert-messages-fixed';
62 onRender : function(ct, position)
64 Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
67 var cfg = Roo.apply({}, this.getAutoCreate());
71 cfg.cls += ' ' + this.cls;
74 cfg.style = this.style;
76 this.el = Roo.get(document.body).createChild(cfg, Roo.select('.bootstrap-sticky-wrap', true).first());
79 this.el.select('>button.close').on('click', this.hide, this);
91 this.fireEvent('show', this);
99 this.fireEvent('hide', this);
104 // var e = this.el.dom.firstChild;
106 // if(this.closable){
107 // e = e.nextSibling;
110 // e.data = this.html || '';
112 this.el.select('>.message', true).first().dom.innerHTML = this.html || '';