Merge branch 'master' of http://git.roojs.com:8081/roojs1
authorEdward <edward@roojs.com>
Fri, 16 May 2014 04:59:36 +0000 (12:59 +0800)
committerEdward <edward@roojs.com>
Fri, 16 May 2014 04:59:36 +0000 (12:59 +0800)
Roo/bootstrap/Button.js

index 4942c9b..fc5b4bd 100644 (file)
@@ -40,10 +40,17 @@ Roo.bootstrap.Button = function(config){
         // raw events
         /**
          * @event click
-         * The raw click event for the entire grid.
+         * When a butotn is pressed
          * @param {Roo.EventObject} e
          */
-        "click" : true
+        "click" : true,
+         /**
+         * @event toggle
+         * After the button has been toggles
+         * @param {Roo.EventObject} e
+         * @param {boolean} pressed (also available as button.pressed)
+         */
+        "toggle" : true
     });
 };
 
@@ -274,8 +281,8 @@ Roo.extend(Roo.bootstrap.Button, Roo.bootstrap.Component,  {
         }
         if (this.pressed === true || this.pressed === false) {
             this.pressed = !this.pressed;
-            this[this.pressed ? 'addClass' : 'removeClass']('active');
-            this.fireEvent('toggle', this,e);
+            this.el[this.pressed ? 'addClass' : 'removeClass']('active');
+            this.fireEvent('toggle', this, e, this.pressed);
         }