Checkboxradio: Check that there is an icon before toggeling class

Fixes #14939
Closes gh-1686
This commit is contained in:
Alexander Schmitz 2016-03-23 08:18:25 -04:00 committed by Scott González
parent 89fe04af3d
commit 882eb4cbf2

View File

@ -115,8 +115,10 @@ $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
if ( checked ) { if ( checked ) {
this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" ); this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
if ( this.icon ) {
this._addClass( this.icon, null, "ui-state-hover" ); this._addClass( this.icon, null, "ui-state-hover" );
} }
}
this._on( { this._on( {
change: "_toggleClasses", change: "_toggleClasses",