@@ -22,22 +22,22 @@ var baseClasses = "ui-button ui-widget ui-corner-all",
22
22
} , 1 ) ;
23
23
} ,
24
24
radioGroup = function ( radio ) {
25
- var name = radio . name ,
26
- form = radio . form ,
27
- radios = $ ( [ ] ) ;
28
- if ( name ) {
29
- name = name . replace ( / ' / g, "\\'" ) ;
30
- if ( form ) {
31
- radios = $ ( form ) . find ( "[name='" + name + "']" ) ;
32
- } else {
33
- radios = $ ( "[name='" + name + "']" , radio . ownerDocument )
34
- . filter ( function ( ) {
35
- return ! this . form ;
36
- } ) ;
37
- }
38
- }
39
- return radios ;
40
- } ;
25
+ var name = radio . name ,
26
+ form = radio . form ,
27
+ radios = $ ( [ ] ) ;
28
+ if ( name ) {
29
+ name = name . replace ( / ' / g, "\\'" ) ;
30
+ if ( form ) {
31
+ radios = $ ( form ) . find ( "[name='" + name + "']" ) ;
32
+ } else {
33
+ radios = $ ( "[name='" + name + "']" , radio . ownerDocument )
34
+ . filter ( function ( ) {
35
+ return ! this . form ;
36
+ } ) ;
37
+ }
38
+ }
39
+ return radios ;
40
+ } ;
41
41
42
42
$ . widget ( "ui.checkboxradio" , {
43
43
version : "@VERSION" ,
@@ -78,6 +78,16 @@ $.widget( "ui.checkboxradio", {
78
78
79
79
this . _getLabel ( ) ;
80
80
81
+ this . _enhance ( ) ;
82
+
83
+ this . _on ( {
84
+ "change" : "_toggleClasses" ,
85
+ "focus" : "_handleFocus" ,
86
+ "blur" : "_handleBlur"
87
+ } ) ;
88
+ } ,
89
+
90
+ enhance : function ( ) {
81
91
this . element . addClass ( "ui-helper-hidden-accessible ui-checkboxradio" ) ;
82
92
83
93
this . label . addClass ( baseClasses + " ui-" + this . type + "-label" ) ;
@@ -98,12 +108,6 @@ $.widget( "ui.checkboxradio", {
98
108
if ( this . options . label ) {
99
109
this . label . html ( this . options . label ) ;
100
110
}
101
-
102
- this . _on ( {
103
- "change" : "_toggleClasses" ,
104
- "focus" : "_handleFocus" ,
105
- "blur" : "_handleBlur"
106
- } ) ;
107
111
} ,
108
112
109
113
widget : function ( ) {
@@ -124,7 +128,6 @@ $.widget( "ui.checkboxradio", {
124
128
// Check control.labels first
125
129
if ( this . element [ 0 ] . labels !== undefined ) {
126
130
this . label = $ ( this . element [ 0 ] . labels ) ;
127
- console . log ( this . element [ 0 ] . labels ) ;
128
131
} else {
129
132
130
133
// we don't search against the document in case the element
@@ -154,7 +157,7 @@ $.widget( "ui.checkboxradio", {
154
157
radioGroup ( this . element [ 0 ] )
155
158
. not ( this . element )
156
159
. map ( function ( ) {
157
- return $ ( this ) . checkboxradio ( "widget" ) [ 0 ] ;
160
+ return $ ( this ) . checkboxradio ( "widget" ) [ 0 ] ;
158
161
} )
159
162
. removeClass ( "ui-state-active ui-radio-checked" ) ;
160
163
}
0 commit comments