@@ -57,7 +57,11 @@ $.widget( "ui.checkboxradio", {
57
57
options : {
58
58
disabled : null ,
59
59
label : null ,
60
+ << < << << HEAD
60
61
icon : true ,
62
+ === === =
63
+ icon : false ,
64
+ >>> >>> > db16c96... Checkboxradio: add classes option
61
65
classes: {
62
66
"ui-checkboxradio" : null ,
63
67
"ui-checkbox" : null ,
@@ -187,12 +191,14 @@ $.widget( "ui.checkboxradio", {
187
191
var checked = this . element . is ( ":checked" ) ;
188
192
189
193
this . _updateIcon ( checked ) ;
190
- this . element . addClass ( "ui-helper-hidden-accessible ui-checkboxradio" ) ;
194
+ this . element . addClass ( "ui-helper-hidden-accessible " +
195
+ this . _classes ( "ui-checkboxradio" ) ) ;
191
196
192
- this . label . addClass ( baseClasses + " ui-" + this . type + "-label" ) ;
197
+ this . label . addClass ( baseClasses + " " + this . _classes ( " ui-" + this . type + "-label" ) ) ;
193
198
194
199
if ( checked ) {
195
- this . label . addClass ( "ui-" + this . type + "-checked ui-state-active" ) ;
200
+ this . label . addClass ( this . _classes ( "ui-" + this . type + "-checked" ) +
201
+ " ui-state-active" ) ;
196
202
}
197
203
if ( this.options.label && this . options . label !== this . originalLabel ) {
198
204
this . label . html ( this . icon ? this . icon : "" ) . append ( this . options . label ) ;
@@ -207,7 +213,8 @@ $.widget( "ui.checkboxradio", {
207
213
208
214
_toggleClasses: function() {
209
215
var checked = this . element . is ( ":checked" ) ;
210
- this . label . toggleClass ( "ui-" + this . type + "-checked ui-state-active" , checked ) ;
216
+ this . label . toggleClass ( this . _classes ( "ui-" + this . type + "-checked" ) +
217
+ " ui-state-active" , checked ) ;
211
218
if ( this . options . icon && this . type === "checkbox" ) {
212
219
this . icon
213
220
. toggleClass ( "ui-icon-check" , checked )
@@ -219,7 +226,7 @@ $.widget( "ui.checkboxradio", {
219
226
. map ( function ( ) {
220
227
return $ ( this ) . checkboxradio ( "widget" ) [ 0 ] ;
221
228
} )
222
- . removeClass ( "ui-state-active ui-radio-checked" ) ;
229
+ . removeClass ( "ui-state-active " + this . _classes ( " ui-radio-checked" ) ) ;
223
230
}
224
231
} ,
225
232
@@ -228,7 +235,8 @@ $.widget( "ui.checkboxradio", {
228
235
if ( this . icon ) {
229
236
this . icon . remove ( ) ;
230
237
}
231
- this . element . removeClass ( "ui-checkboxradio ui-helper-hidden-accessible" ) ;
238
+ this.element.removeClass( this._classes( "ui-checkboxradio" ) +
239
+ " ui-helper-hidden-accessible" );
232
240
} ,
233
241
234
242
_setOption : function ( key , value ) {
@@ -249,7 +257,8 @@ $.widget( "ui.checkboxradio", {
249
257
} ,
250
258
251
259
_updateIcon : function ( checked ) {
252
- var toAdd = "ui-icon ui-icon-background ui-corner-all " ;
260
+ var toAdd = this . _classes ( "ui-checkboxradio-icon" ) +
261
+ " ui-icon ui-icon-background " ;
253
262
254
263
if ( this . options . icon ) {
255
264
this . label . addClass ( "ui-icon-beginning" ) ;
@@ -274,7 +283,6 @@ $.widget( "ui.checkboxradio", {
274
283
var checked = this . element . is ( ":checked" ) ,
275
284
isDisabled = this . element . is ( ":disabled" ) ;
276
285
this . _updateIcon ( checked ) ;
277
- console . log ( this . options . label ) ;
278
286
this . label . toggleClass ( "ui-state-active " + this . _classes ( "ui-" + this . type + "-checked" ) , checked ) ;
279
287
if ( this . options . label !== null ) {
280
288
this . label . contents ( ) . not ( this . element . add ( this . icon ) ) . remove ( ) ;
0 commit comments