]> source.dussan.org Git - jquery-ui.git/commitdiff
Button: stop disabled button from firing click events. fixes #5945. Behavior was... 470/head
authorEike Send <eike.send@gmail.com>
Thu, 5 May 2011 12:45:06 +0000 (14:45 +0200)
committerScott González <scott.gonzalez@gmail.com>
Thu, 5 May 2011 12:49:53 +0000 (08:49 -0400)
(cherry picked from commit a7f1659cdc99222a733ed2edbd7d00dc57c30227)

ui/jquery.ui.button.js

index a98e96f46f4ed0ce219fa864e9a535796d56c527..bc8357c089d348d1dc5ec77767bb3a86e3d3ac25 100644 (file)
@@ -102,6 +102,11 @@ $.widget( "ui.button", {
                        })
                        .bind( "blur.button", function() {
                                $( this ).removeClass( focusClass );
+                       })
+                       .bind( "click.button", function( event ) {
+                               if ( options.disabled ) {
+                                       event.stopImmediatePropagation();
+                               }
                        });
 
                if ( toggleButton ) {