Roo/bootstrap/Button.js
[roojs1] / Roo / bootstrap / Button.js
index 4b2d5b9..29beaf8 100644 (file)
@@ -79,7 +79,7 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
     
     
     pressed : null,
-    
+     
     
     getAutoCreate : function(){
         
@@ -264,13 +264,26 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
     initEvents: function() {
        // Roo.log('init events?');
 //        Roo.log(this.el.dom);
+        // add the menu...
+        
+        if (typeof (this.menu) != 'undefined') {
+            this.menu.parentType = this.xtype;
+            this.menu.triggerEl = this.el;
+            this.addxtype(Roo.apply({}, this.menu));
+        }
+
+
        if (this.el.hasClass('roo-button')) {
             this.el.on('click', this.onClick, this);
        } else {
             this.el.select('.roo-button').on('click', this.onClick, this);
        }
        
+       if(this.removeClass){
+           this.el.on('click', this.onClick, this);
+       }
        
+       this.el.enableDisplayMode();
         
     },
     onClick : function(e)
@@ -331,10 +344,22 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
     setText : function(str)
     {
         this.el.select('.roo-button-text',true).first().dom.innerHTML = str;
+    },
+    getText : function()
+    {
+        return this.el.select('.roo-button-text',true).first().dom.innerHTML;
+    },
+    hide: function() {
+       
+     
+        this.el.hide();   
+    },
+    show: function() {
+       
+        this.el.show();   
     }
     
     
-    
 });
 
  
\ No newline at end of file