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
17 * Create a new Element
18 * @param {Object} config The config object
21 Roo.bootstrap.MessageBar = function(config){
22 Roo.bootstrap.MessageBar.superclass.constructor.call(this, config);
25 Roo.extend(Roo.bootstrap.MessageBar, Roo.bootstrap.Component, {
31 getAutoCreate : function(){
35 cls: 'alert alert-dismissable alert-messages alert-' + this.weight,
56 onRender : function(ct, position)
58 Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
61 var cfg = Roo.apply({}, this.getAutoCreate());
64 // cfg.name = typeof(this.name) == 'undefined' ? this.id : this.name;
66 //if (!cfg.name.length) {
70 cfg.cls += ' ' + this.cls;
73 cfg.style = this.style;
75 this.el = Roo.get(document.body).createChild(cfg, position);
78 this.el.select('>button.close').on('click', this.hide, this);
88 Roo.select('.bootstrap-sticky-wrap', true).first().setStyle('margin-top', this.el.getHeight() + 'px');
90 var navbar_fixed_top = Roo.select('.navbar-fixed-top', true).first();
92 if(navbar_fixed_top != null){
93 navbar_fixed_top.setStyle('margin-top', this.el.getHeight() + 'px');
102 Roo.select('.bootstrap-sticky-wrap', true).first().setStyle('margin-top', '0px');
104 var navbar_fixed_top = Roo.select('.navbar-fixed-top', true).first();
106 if(navbar_fixed_top != null){
107 navbar_fixed_top.setStyle('margin-top', '0px');