@@ -36,8 +36,9 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
3636 uncheckedState = inputtype + "-off" ,
3737 icon = uncheckedState ,
3838 iconpos = inheritAttr ( input , "iconpos" ) ,
39- activeBtn = icon ? "" : " " + $ . mobile . activeBtnClass ,
40- checkedClass = "ui-" + checkedState + activeBtn ,
39+ horizontal = input . parents ( ":jqmData(type='horizontal')" ) . length ,
40+ activeBtn = $ . mobile . activeBtnClass ,
41+ checkedClass = "ui-" + checkedState ,
4142 uncheckedClass = "ui-" + uncheckedState ,
4243 checkedicon = icon ? checkedState : undefined ,
4344 uncheckedicon = icon ? uncheckedState : undefined ;
@@ -50,6 +51,8 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
5051 $ . extend ( this , {
5152 label : label ,
5253 inputtype : inputtype ,
54+ horizontal : horizontal ,
55+ activeBtn : activeBtn ,
5356 checkedClass : checkedClass ,
5457 uncheckedClass : uncheckedClass ,
5558 checkedicon : checkedicon ,
@@ -182,11 +185,15 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
182185 refresh : function ( ) {
183186 var input = this . element [ 0 ] ,
184187 label = this . label ;
188+
189+ if ( this . horizontal ) {
190+ this . checkedClass = this . checkedClass + " " + this . activeBtn ;
191+ }
185192
186193 if ( input . checked ) {
187194 label . addClass ( this . checkedClass ) . removeClass ( this . uncheckedClass ) . buttonMarkup ( { icon : this . checkedicon } ) ;
188195 } else {
189- label . removeClass ( this . checkedClass ) . addClass ( this . uncheckedClass ) . buttonMarkup ( { icon : this . uncheckedicon } ) ; ;
196+ label . removeClass ( this . checkedClass ) . addClass ( this . uncheckedClass ) . buttonMarkup ( { icon : this . uncheckedicon } ) ;
190197 }
191198
192199 if ( input . disabled ) {
0 commit comments