File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 5151
5252 widget . _disabled = false ;
5353 widget . _checked = false ;
54-
54+
5555 widget . _registerEventListeners ( ) ;
5656
5757 var disabled = widget . element . attr ( 'disabled' ) ;
6464
6565 if ( typeof checked !== typeof undefined && checked !== false ) {
6666 widget . checked ( true ) ;
67+ widget . _wasCheckedInitially = true ;
6768 }
6869
6970 widget . _trigger ( 'hasBeenInitialized' ) ;
125126 var widget = this ;
126127
127128 widget . element . on ( 'change' , widget . _onChange . bind ( widget ) ) ;
129+ widget . element . closest ( 'form' ) . on ( 'reset' , widget . _onReset . bind ( widget ) ) ;
128130
129131 if ( widget . element . parents ( 'label' ) . length == 0 ) {
130132 widget . wrapper . on ( 'click' , widget . _onClick . bind ( widget ) ) ;
138140 widget . _uncheckOtherRadios ( ) ;
139141 } ,
140142
143+ _onReset : function ( ) {
144+ var widget = this ;
145+ widget . checked ( ! ! widget . _wasCheckedInitially ) ;
146+
147+ widget . _uncheckOtherRadios ( ) ;
148+ } ,
149+
141150 _onClick : function ( event ) {
142151 var widget = this ;
143152 var source = event . target || event . srcElement ;
171180 }
172181 } ) ;
173182
174- } ) ( jQuery , window , document ) ;
183+ } ) ( jQuery , window , document ) ;
You can’t perform that action at this time.
0 commit comments