@@ -16,6 +16,8 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
1616 //filter works though.
1717 label = input . closest ( "form,fieldset,:jqmData(role='page')" ) . find ( "label" ) . filter ( '[for="' + input [ 0 ] . id + '"]' ) ,
1818 inputtype = input . attr ( "type" ) ,
19+ checkedClass = "ui-" + inputtype + "-on" ,
20+ uncheckedClass = "ui-" + inputtype + "-off" ,
1921 checkedicon = "ui-icon-" + inputtype + "-on" ,
2022 uncheckedicon = "ui-icon-" + inputtype + "-off" ;
2123
@@ -25,6 +27,8 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
2527 $ . extend ( this , {
2628 label : label ,
2729 inputtype : inputtype ,
30+ checkedClass : checkedClass ,
31+ uncheckedClass : uncheckedClass ,
2832 checkedicon : checkedicon ,
2933 uncheckedicon : uncheckedicon
3034 } ) ;
@@ -133,9 +137,11 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
133137 // input[0].checked expando doesn't always report the proper value
134138 // for checked='checked'
135139 if ( $ ( input [ 0 ] ) . prop ( 'checked' ) ) {
140+ label . addClass ( this . checkedClass ) . removeClass ( this . uncheckedClass ) ;
136141 icon . addClass ( this . checkedicon ) . removeClass ( this . uncheckedicon ) ;
137142
138143 } else {
144+ label . removeClass ( this . checkedClass ) . addClass ( this . uncheckedClass ) ;
139145 icon . removeClass ( this . checkedicon ) . addClass ( this . uncheckedicon ) ;
140146 }
141147
0 commit comments