@@ -57,7 +57,17 @@ $.widget( "ui.checkboxradio", {
5757 options : {
5858 disabled : null ,
5959 label : null ,
60- icon : false
60+ icon : false ,
61+ classes : {
62+ "ui-checkboxradio" : null ,
63+ "ui-checkbox" : null ,
64+ "ui-radio" : null ,
65+ "ui-checkbox-label" : "ui-corner-all" ,
66+ "ui-radio-label" : "ui-corner-all" ,
67+ "ui-checkboxradio-icon" : "ui-corner-all" ,
68+ "ui-radio-checked" : null ,
69+ "ui-checkbox-checked" : null
70+ }
6171 } ,
6272
6373 _getCreateOptions : function ( ) {
@@ -168,12 +178,14 @@ $.widget( "ui.checkboxradio", {
168178 var checked = this . element . is ( ":checked" ) ;
169179
170180 this . _updateIcon ( checked ) ;
171- this . element . addClass ( "ui-helper-hidden-accessible ui-checkboxradio" ) ;
181+ this . element . addClass ( "ui-helper-hidden-accessible " +
182+ this . _classes ( "ui-checkboxradio" ) ) ;
172183
173- this . label . addClass ( baseClasses + " ui-" + this . type + "-label" ) ;
184+ this . label . addClass ( baseClasses + " " + this . _classes ( " ui-" + this . type + "-label" ) ) ;
174185
175186 if ( checked ) {
176- this . label . addClass ( "ui-" + this . type + "-checked ui-state-active" ) ;
187+ this . label . addClass ( this . _classes ( "ui-" + this . type + "-checked" ) +
188+ " ui-state-active" ) ;
177189 }
178190 if ( this . options . label && this . options . label !== this . originalLabel ) {
179191 this . label . html ( this . icon ? this . icon : "" ) . append ( this . options . label ) ;
@@ -188,7 +200,8 @@ $.widget( "ui.checkboxradio", {
188200
189201 _toggleClasses : function ( ) {
190202 var checked = this . element . is ( ":checked" ) ;
191- this . label . toggleClass ( "ui-" + this . type + "-checked ui-state-active" , checked ) ;
203+ this . label . toggleClass ( this . _classes ( "ui-" + this . type + "-checked" ) +
204+ " ui-state-active" , checked ) ;
192205 if ( this . options . icon && this . type === "checkbox" ) {
193206 this . icon
194207 . toggleClass ( "ui-icon-check" , checked )
@@ -200,7 +213,7 @@ $.widget( "ui.checkboxradio", {
200213 . map ( function ( ) {
201214 return $ ( this ) . checkboxradio ( "widget" ) [ 0 ] ;
202215 } )
203- . removeClass ( "ui-state-active ui-radio-checked" ) ;
216+ . removeClass ( "ui-state-active " + this . _classes ( " ui-radio-checked" ) ) ;
204217 }
205218 } ,
206219
@@ -209,7 +222,8 @@ $.widget( "ui.checkboxradio", {
209222 if ( this . icon ) {
210223 this . icon . remove ( ) ;
211224 }
212- this . element . removeClass ( "ui-checkboxradio ui-helper-hidden-accessible" ) ;
225+ this . element . removeClass ( this . _classes ( "ui-checkboxradio" ) +
226+ " ui-helper-hidden-accessible" ) ;
213227 } ,
214228
215229 _setOption : function ( key , value ) {
@@ -230,7 +244,8 @@ $.widget( "ui.checkboxradio", {
230244 } ,
231245
232246 _updateIcon : function ( checked ) {
233- var toAdd = "ui-icon ui-icon-background ui-corner-all " ;
247+ var toAdd = this . _classes ( "ui-checkboxradio-icon" ) +
248+ " ui-icon ui-icon-background " ;
234249
235250 if ( this . options . icon ) {
236251 this . label . addClass ( "ui-icon-beginning" ) ;
@@ -255,7 +270,7 @@ $.widget( "ui.checkboxradio", {
255270 var checked = this . element . is ( ":checked" ) ,
256271 isDisabled = this . element . is ( ":disabled" ) ;
257272 this . _updateIcon ( checked ) ;
258- this . label . toggleClass ( "ui-state-active ui-" + this . type + "-checked" , checked ) ;
273+ this . label . toggleClass ( "ui-state-active " + this . _classes ( " ui-" + this . type + "-checked" ) , checked ) ;
259274 if ( this . options . label !== null ) {
260275 this . label . html ( ! ! this . icon ? this . icon : "" ) . append ( this . options . label ) ;
261276 }
0 commit comments