diff options
author | Eike Send <eike.send@gmail.com> | 2011-05-05 14:45:06 +0200 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-05-05 08:49:53 -0400 |
commit | 4c218eeb0a4e6b06d055fcfe0b45ff034ecbfa43 (patch) | |
tree | abf7a3a09128c36e92b6846aa5ecb4c7ca98742f /ui/jquery.ui.button.js | |
parent | 870977ae6b314cecb27a7bfe18b0fdf46c8e9f79 (diff) | |
download | jquery-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.js | 5 |
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 ) { |