Button: Style updates

Ref #14246
This commit is contained in:
Alexander Schmitz 2015-08-24 09:00:22 -04:00
parent a380d2d09e
commit b2bf10e0ec

View File

@ -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" );