remove debugging code
[roojs1] / Roo / bootstrap / MessageBar.js
index fe0f67e..68170fa 100644 (file)
@@ -11,7 +11,8 @@
  * Bootstrap MessageBar class
  * @cfg {String} html contents of the MessageBar
  * @cfg {String} weight (info | success | warning | danger) default info
- * @cfg {Boolean} closable (true | false) default true
+ * @cfg {String} beforeClass insert the bar before the given class
+ * @cfg {Boolean} closable (true | false) default false
  * @cfg {Boolean} fixed (true | false) default false, fix the bar at the top
  * 
  * @constructor
@@ -27,8 +28,9 @@ Roo.extend(Roo.bootstrap.MessageBar, Roo.bootstrap.Component,  {
     
     html: '',
     weight: 'info',
-    closable: true,
+    closable: false,
     fixed: false,
+    beforeClass: 'bootstrap-sticky-wrap',
     
     getAutoCreate : function(){
         
@@ -42,16 +44,12 @@ Roo.extend(Roo.bootstrap.MessageBar, Roo.bootstrap.Component,  {
                     html: this.html || ''
                 }
             ]
-        }
+        };
         
         if(this.fixed){
             cfg.cls += ' alert-messages-fixed';
         }
         
-        if(!this.fixed){
-            cfg.cls += ' alert-messages-relative';
-        }
-        
         if(this.closable){
             cfg.cn.push({
                 tag: 'button',
@@ -77,7 +75,9 @@ Roo.extend(Roo.bootstrap.MessageBar, Roo.bootstrap.Component,  {
             if (this.style) {
                 cfg.style = this.style;
             }
-            this.el = Roo.get(document.body).createChild(cfg, Roo.select('.bootstrap-sticky-wrap', true).first());
+            this.el = Roo.get(document.body).createChild(cfg, Roo.select('.'+this.beforeClass, true).first());
+            
+            this.el.setVisibilityMode(Roo.Element.DISPLAY);
         }
         
         this.el.select('>button.close').on('click', this.hide, this);
@@ -98,6 +98,10 @@ Roo.extend(Roo.bootstrap.MessageBar, Roo.bootstrap.Component,  {
     
     hide : function()
     {
+        if (!this.rendered) {
+            this.render();
+        }
+        
         this.el.hide();
         
         this.fireEvent('hide', this);