From 50a7a3d6a9e4fe0e396661ad32a62f176ab24116 Mon Sep 17 00:00:00 2001 From: Alexander Schmitz Date: Mon, 17 Aug 2015 08:43:31 -0400 Subject: Controlgroup: Fixes for spinner --- ui/widgets/controlgroup.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/widgets/controlgroup.js b/ui/widgets/controlgroup.js index 4e68ad7a8..c895ab09e 100644 --- a/ui/widgets/controlgroup.js +++ b/ui/widgets/controlgroup.js @@ -97,6 +97,9 @@ return $.widget( "ui.controlgroup", { } ); } else if ( selector && widget === "controlgroupLabel" ) { labels = that.element.find( selector ); + labels.each( function() { + $( this ).contents().wrapAll( "" ); + } ); that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" ); Array.prototype.push.apply( childWidgets, labels.get() ); } @@ -117,9 +120,9 @@ return $.widget( "ui.controlgroup", { }, _updateCornerClass: function( element, position ) { - var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right", - add = - this._buildSimpleOptions( position, this.options.direction, "label" ).classes.label; + var direction = this.options.direction === "vertical" + remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right", + add = this._buildSimpleOptions( position, direction, "label" ).classes.label; this._removeClass( element, null, remove ); this._addClass( element, null, add ); @@ -219,7 +222,7 @@ return $.widget( "ui.controlgroup", { $.each( [ "first", "last" ], function( index, value ) { var instance = children[ value ]().data( "ui-controlgroup-data" ); - if ( that[ "_" + instance.widgetName + "_options" ] ) { + if ( instance && that[ "_" + instance.widgetName + "_options" ] ) { instance.element[ instance.widgetName ]( that[ "_" + instance.widgetName + "_options" ]( value, -- cgit v1.2.3