Button: stop disabled button from firing click events. fixes #5945. Behavior was inconsisten between BUTTON and A elements.

(cherry picked from commit a7f1659cdc)
This commit is contained in:
Eike Send 2011-05-05 14:45:06 +02:00 committed by Scott González
parent 870977ae6b
commit 4c218eeb0a

View 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 ) {