aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2016-05-11 12:14:14 -0400
committerAlexander Schmitz <arschmitz@gmail.com>2016-05-26 09:15:48 -0400
commit7d5e6d24969ef84eee51ae5b1557c7ce2e83c9ea (patch)
tree497c0126545ba1eea94694d12a54ecc696c6060d /ui
parent81a8e30c07a3663728c98b15775b5580fa806cdd (diff)
downloadjquery-ui-7d5e6d24969ef84eee51ae5b1557c7ce2e83c9ea.tar.gz
jquery-ui-7d5e6d24969ef84eee51ae5b1557c7ce2e83c9ea.zip
Controlgroup: Fix rendering of labels
Fixes #14967 Closes gh-1703
Diffstat (limited to 'ui')
-rw-r--r--ui/widgets/controlgroup.js13
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;
},