Button: Set ui-state-active class accordingly to the checkbox state. Fixe #402

Closed
wants to merge 4 commits into
from
View
@@ -146,9 +146,15 @@ $.widget( "ui.button", {
if ( options.disabled || clickDragged ) {
return false;
}
- $( this ).toggleClass( "ui-state-active" );
- self.buttonElement.attr( "aria-pressed", self.element[0].checked );
+ $( this ).toggleClass( "ui-state-active", !self.element[0].checked );
+ self.buttonElement.attr( "aria-pressed", !self.element[0].checked );
});
+ this.buttonElement.bind( "dblclick.buttonElement", function() {
+ if ( options.disabled || clickDragged ) {
+ return false;
+ }
+ self.refresh();
+ });
} else if ( this.type === "radio" ) {
this.buttonElement.bind( "click.button", function() {
if ( options.disabled || clickDragged ) {