mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
parent
a380d2d09e
commit
b2bf10e0ec
@ -189,6 +189,7 @@ $.widget( "ui.button", {
|
||||
$( this ).addClass( "ui-state-active" );
|
||||
}
|
||||
} )
|
||||
|
||||
// see #8559, we bind to blur here in case the button element loses
|
||||
// focus between keydown and keyup, it would be left in an "active" state
|
||||
.on( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
|
||||
@ -198,6 +199,7 @@ $.widget( "ui.button", {
|
||||
if ( this.buttonElement.is( "a" ) ) {
|
||||
this.buttonElement.on( "keyup", function( event ) {
|
||||
if ( event.keyCode === $.ui.keyCode.SPACE ) {
|
||||
|
||||
// TODO pass through original event correctly (just as 2nd argument doesn't work)
|
||||
$( this ).trigger( "click" );
|
||||
}
|
||||
@ -223,6 +225,7 @@ $.widget( "ui.button", {
|
||||
}
|
||||
|
||||
if ( this.type === "checkbox" || this.type === "radio" ) {
|
||||
|
||||
// we don't search against the document in case the element
|
||||
// is disconnected from the DOM
|
||||
ancestor = this.element.parents().last();
|
||||
@ -282,6 +285,7 @@ $.widget( "ui.button", {
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
|
||||
//See #8237 & #8828
|
||||
var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user