Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
[checkboxradio] Use .buttonMarkup() to update icon instead of class m…
Browse files Browse the repository at this point in the history
…anipulation
  • Loading branch information
Gabriel Schulhof committed Nov 5, 2012
1 parent 2e2d3dc commit bb49223
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions js/widgets/forms/checkboxradio.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
activeBtn = icon ? "" : " " + $.mobile.activeBtnClass,
checkedClass = "ui-" + checkedState + activeBtn,
uncheckedClass = "ui-" + uncheckedState,
checkedicon = "ui-icon-" + checkedState,
uncheckedicon = "ui-icon-" + uncheckedState;
checkedicon = checkedState,
uncheckedicon = uncheckedState;

if ( inputtype !== "checkbox" && inputtype !== "radio" ) {
return;
Expand Down Expand Up @@ -179,15 +179,12 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {

refresh: function() {
var input = this.element[0],
label = this.label,
icon = label.find( ".ui-icon" );
label = this.label;

if ( input.checked ) {
label.addClass( this.checkedClass ).removeClass( this.uncheckedClass );
icon.addClass( this.checkedicon ).removeClass( this.uncheckedicon );
label.addClass( this.checkedClass ).removeClass( this.uncheckedClass ).buttonMarkup( { icon: this.checkedicon } );
} else {
label.removeClass( this.checkedClass ).addClass( this.uncheckedClass );
icon.removeClass( this.checkedicon ).addClass( this.uncheckedicon );
label.removeClass( this.checkedClass ).addClass( this.uncheckedClass ).buttonMarkup( { icon: this.uncheckedicon } );;
}

if ( input.disabled ) {
Expand Down

0 comments on commit bb49223

Please sign in to comment.