@@ -30,24 +30,7 @@ var formResetHandler = function() {
30
30
form . find ( ".ui-checkboxradio" ) . checkboxradio ( "refresh" ) ;
31
31
} ) ;
32
32
} ,
33
- escapeId = new RegExp ( / ( [ ! " # $ % & ' ( ) * + , . / : ; < = > ? @ [ \] ^ ` { | } ~ ] ) / g ) ,
34
- radioGroup = function ( radio ) {
35
- var name = radio . name ,
36
- form = radio . form ,
37
- radios = $ ( [ ] ) ;
38
- if ( name ) {
39
- name = name . replace ( / ' / g, "\\'" ) ;
40
- if ( form ) {
41
- radios = $ ( form ) . find ( "[name='" + name + "']" ) ;
42
- } else {
43
- radios = $ ( "[name='" + name + "']" , radio . ownerDocument )
44
- . filter ( function ( ) {
45
- return ! this . form ;
46
- } ) ;
47
- }
48
- }
49
- return radios ;
50
- } ;
33
+ escapeId = new RegExp ( / ( [ ! " # $ % & ' ( ) * + , . / : ; < = > ? @ [ \] ^ ` { | } ~ ] ) / g ) ;
51
34
52
35
$ . widget ( "ui.checkboxradio" , {
53
36
version : "@VERSION" ,
@@ -186,6 +169,24 @@ $.widget( "ui.checkboxradio", {
186
169
return this . label ;
187
170
} ,
188
171
172
+ _getRadioGroup : function ( radio ) {
173
+ var name = this . element [ 0 ] . name ,
174
+ form = this . element [ 0 ] . form ,
175
+ radios = $ ( [ ] ) ;
176
+ if ( name ) {
177
+ name = name . replace ( / ' / g, "\\'" ) ;
178
+ if ( form ) {
179
+ radios = $ ( form ) . find ( "[name='" + name + "']" ) ;
180
+ } else {
181
+ radios = $ ( "[name='" + name + "']" , radio . ownerDocument )
182
+ . filter ( function ( ) {
183
+ return ! this . form ;
184
+ } ) ;
185
+ }
186
+ }
187
+ return radios . not ( this . element ) ;
188
+ } ,
189
+
189
190
_toggleClasses : function ( ) {
190
191
var checked = this . element [ 0 ] . checked ;
191
192
this . _toggleClass ( this . label , "ui-checkboxradio-checked" , "ui-state-active" , checked ) ;
@@ -194,8 +195,7 @@ $.widget( "ui.checkboxradio", {
194
195
. _toggleClass ( this . icon , null , "ui-icon-blank" , ! checked ) ;
195
196
}
196
197
if ( this . type === "radio" ) {
197
- radioGroup ( this . element [ 0 ] )
198
- . not ( this . element )
198
+ this . _getRadioGroup ( )
199
199
. each ( function ( ) {
200
200
var instance = $ ( this ) . checkboxradio ( "instance" ) ;
201
201
0 commit comments