diff options
Diffstat (limited to 'ui/widgets/controlgroup.js')
-rw-r--r-- | ui/widgets/controlgroup.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ui/widgets/controlgroup.js b/ui/widgets/controlgroup.js index 34b2ba9c7..a79491bfb 100644 --- a/ui/widgets/controlgroup.js +++ b/ui/widgets/controlgroup.js @@ -30,7 +30,7 @@ factory( jQuery ); } }( function( $ ) { -var removeClassRegex = /ui-corner-([a-z]){2,6}/g; +var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g; return $.widget( "ui.controlgroup", { version: "@VERSION", @@ -87,7 +87,12 @@ return $.widget( "ui.controlgroup", { if ( widget === "controlgroupLabel" ) { labels = that.element.find( selector ); labels.each( function() { - $( this ).contents() + var element = $( this ); + + if ( element.children( ".ui-controlgroup-label-contents" ).length ) { + return; + } + element.contents() .wrapAll( "<span class='ui-controlgroup-label-contents'></span>" ); } ); that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" ); @@ -210,8 +215,8 @@ return $.widget( "ui.controlgroup", { _resolveClassesValues: function( classes, instance ) { $.each( classes, function( key ) { var current = instance.options.classes[ key ] || ""; - current = current.replace( removeClassRegex, "" ).trim(); - classes[ key ] = ( current + " " + classes[ key ] ).replace( / +/g, " " ); + current = current.replace( controlgroupCornerRegex, "" ).trim(); + classes[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " ); } ); return classes; }, |