aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorEike Send <eike.send@gmail.com>2011-05-05 14:45:06 +0200
committerEike Send <eike.send@gmail.com>2011-05-05 14:45:06 +0200
commita7f1659cdc99222a733ed2edbd7d00dc57c30227 (patch)
treed4168bc61e33228aaba38fa1baf3a449e7bdd2bc /ui
parent116acb4cb28c4a091547648132316b7f8e9e6072 (diff)
downloadjquery-ui-a7f1659cdc99222a733ed2edbd7d00dc57c30227.tar.gz
jquery-ui-a7f1659cdc99222a733ed2edbd7d00dc57c30227.zip
Button: stop disabled button from firing click events. fixes #5945. Behavior was inconsisten between BUTTON and A elements.
Diffstat (limited to 'ui')
-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 5777d4753..031ac2091 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -103,6 +103,11 @@ $.widget( "ui.button", {
})
.bind( "blur.button", function() {
$( this ).removeClass( focusClass );
+ })
+ .bind( "click.button", function( event ) {
+ if ( options.disabled ) {
+ event.stopImmediatePropagation();
+ }
});
if ( toggleButton ) {