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

This commit is contained in:
Eike Send 2011-05-05 14:45:06 +02:00
parent 116acb4cb2
commit a7f1659cdc

View File

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