@@ -80,25 +80,25 @@ return $.widget( "ui.controlgroup", {
8080 // Make sure the widget actually exists and has a selector set
8181 if ( $ . fn [ widget ] && selector ) {
8282
83- // Find instances of this widget inside controlgroup and run method or set options
83+ // Find instances of this widget inside controlgroup and set options
8484 widgets = that . element . find ( selector ) [ widget ] ( options ) ;
8585
86- // Don't set data or add to the collection if the method is destroy
8786 widgets . each ( function ( ) {
88- var element = $ ( this ) ;
87+ var element = $ ( this ) ,
8988
9089 // Set data on the widget element pointing to the this.element of the widget
9190 // and telling us what type of widget this is
92- var widgetElement =
93- element [ widget ] ( "widget" ) . data ( "ui-controlgroup-data" , element . data ( "ui-" +
94- widget . charAt ( 0 ) . toUpperCase ( ) + widget . slice ( 1 ) ) ) ;
91+ widgetElement = element [ widget ] ( "widget" ) . data (
92+ "ui-controlgroup-data" ,
93+ element . data ( "ui-" + widget . charAt ( 0 ) . toUpperCase ( ) + widget . slice ( 1 ) )
94+ ) ;
9595
9696 childWidgets . push ( widgetElement [ 0 ] ) ;
9797 } ) ;
9898 } else if ( selector && widget === "controlgroupLabel" ) {
9999 labels = that . element . find ( selector ) ;
100100 that . _addClass ( labels , null , "ui-widget ui-widget-content ui-state-default" ) ;
101- Array . prototype . push . apply ( childWidgets , labels ) ;
101+ Array . prototype . push . apply ( childWidgets , labels . get ( ) ) ;
102102 }
103103 } ) ;
104104
@@ -116,6 +116,15 @@ return $.widget( "ui.controlgroup", {
116116 } ) ;
117117 } ,
118118
119+ _updateCornerClass : function ( element , position ) {
120+ var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right" ,
121+ add =
122+ this . _buildSimpleOptions ( position , this . options . direction , "label" ) . classes . label ;
123+
124+ this . _removeClass ( element , null , remove ) ;
125+ this . _addClass ( element , null , add ) ;
126+ } ,
127+
119128 _buildSimpleOptions : function ( position , direction , key ) {
120129 var result = {
121130 classes : { }
@@ -217,6 +226,8 @@ return $.widget( "ui.controlgroup", {
217226 that . options . direction === "vertical"
218227 )
219228 ) ;
229+ } else {
230+ that . _updateCornerClass ( children [ value ] ( ) , value ) ;
220231 }
221232 } ) ;
222233
0 commit comments