aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.button.js
diff options
context:
space:
mode:
authorEike Send <eike.send@gmail.com>2011-05-05 14:45:06 +0200
committerScott González <scott.gonzalez@gmail.com>2011-05-05 08:49:53 -0400
commit4c218eeb0a4e6b06d055fcfe0b45ff034ecbfa43 (patch)
treeabf7a3a09128c36e92b6846aa5ecb4c7ca98742f /ui/jquery.ui.button.js
parent870977ae6b314cecb27a7bfe18b0fdf46c8e9f79 (diff)
downloadjquery-ui-4c218eeb0a4e6b06d055fcfe0b45ff034ecbfa43.tar.gz
jquery-ui-4c218eeb0a4e6b06d055fcfe0b45ff034ecbfa43.zip
Button: stop disabled button from firing click events. fixes #5945. Behavior was inconsisten between BUTTON and A elements.
(cherry picked from commit a7f1659cdc99222a733ed2edbd7d00dc57c30227)
Diffstat (limited to 'ui/jquery.ui.button.js')
-rw-r--r--ui/jquery.ui.button.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index a98e96f46..bc8357c08 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -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 ) {