Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Button: Check for ui-state-disabled during refresh. Fixes #8237 - But…
…ton: Anchor tags cannot be disabled within buttonset.
  • Loading branch information
tjvantoll authored and scottgonzalez committed Oct 17, 2012
1 parent 8ce3519 commit 5e24a1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/unit/button/button_tickets.js
Expand Up @@ -61,4 +61,12 @@ test( "#7534 - Button label selector works for ids with \":\"", function() {
ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" );
});

test( "#8237 - Anchor tags lose disabled state when refreshed", function() {
expect( 1 );
var element = $( "<a id='a8237'></a>" ).appendTo( "#qunit-fixture" );

element.button({ disabled: true }).button( "refresh" );
ok( element.button( "option", "disabled" ), "Anchor button should remain disabled after refresh" );
});

})( jQuery );
2 changes: 1 addition & 1 deletion ui/jquery.ui.button.js
Expand Up @@ -282,7 +282,7 @@ $.widget( "ui.button", {
},

refresh: function() {
var isDisabled = this.element.is( ":disabled" );
var isDisabled = this.element.is( ":disabled" ) || this.element.hasClass( "ui-button-disabled" );
if ( isDisabled !== this.options.disabled ) {
this._setOption( "disabled", isDisabled );
}
Expand Down

0 comments on commit 5e24a1c

Please sign in to comment.