Roo/bootstrap/Button.js
authorAlan Knowles <alan@roojs.com>
Fri, 16 May 2014 04:48:11 +0000 (12:48 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 16 May 2014 04:48:11 +0000 (12:48 +0800)
Roo/bootstrap/Button.js

index 9472908..4942c9b 100644 (file)
@@ -272,6 +272,12 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
         if(this.preventDefault){
             e.preventDefault();
         }
+        if (this.pressed === true || this.pressed === false) {
+            this.pressed = !this.pressed;
+            this[this.pressed ? 'addClass' : 'removeClass']('active');
+            this.fireEvent('toggle', this,e);
+        }
+        
         
         this.fireEvent('click', this, e);
     }