@@ -69,13 +69,15 @@ return $.widget( "ui.controlgroup", {
69
69
70
70
// First we iterate over each of the items options
71
71
$ . each ( this . options . items , function ( widget , selector ) {
72
- var widgets , labels ,
73
- options = { } ;
72
+ var labels ;
73
+ var options = { } ;
74
74
75
75
// Make sure the widget actually exists and has a selector set
76
76
if ( ! $ . fn [ widget ] || ! selector ) {
77
77
return ;
78
- } else if ( selector && widget === "controlgroupLabel" ) {
78
+ }
79
+
80
+ if ( widget === "controlgroupLabel" ) {
79
81
labels = that . element . find ( selector ) ;
80
82
labels . each ( function ( ) {
81
83
$ ( this ) . contents ( ) . wrapAll ( "<span class='ui-controlgroup-label-contents'></span>" ) ;
@@ -92,19 +94,19 @@ return $.widget( "ui.controlgroup", {
92
94
}
93
95
94
96
// Find instances of this widget inside controlgroup and init them
95
- widgets = that . element . find ( selector ) [ widget ] ( options ) ;
96
-
97
- widgets . each ( function ( ) {
98
- var element = $ ( this ) ;
99
-
100
- // Store an instance of the controlgroup to be able to reference
101
- // from the outermost element for changing options and refresh
102
- var widgetElement = element [ widget ] ( "widget" ) ;
103
- $ . data ( widgetElement [ 0 ] , "ui-controlgroup-data" ,
104
- element [ widget ] ( "instance" ) ) ;
105
-
106
- childWidgets . push ( widgetElement [ 0 ] ) ;
107
- } ) ;
97
+ that . element
98
+ . find ( selector ) [ widget ] ( options )
99
+ . each ( function ( ) {
100
+ var element = $ ( this ) ;
101
+
102
+ // Store an instance of the controlgroup to be able to reference
103
+ // from the outermost element for changing options and refresh
104
+ var widgetElement = element [ widget ] ( "widget" ) ;
105
+ $ . data ( widgetElement [ 0 ] , "ui-controlgroup-data" ,
106
+ element [ widget ] ( "instance" ) ) ;
107
+
108
+ childWidgets . push ( widgetElement [ 0 ] ) ;
109
+ } ) ;
108
110
} ) ;
109
111
110
112
this . childWidgets = $ ( $ . unique ( childWidgets ) ) ;
0 commit comments