aboutsummaryrefslogtreecommitdiffstats
path: root/ui/widgets/controlgroup.js
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2016-05-18 11:48:47 -0400
committerAlexander Schmitz <arschmitz@gmail.com>2016-06-09 14:10:40 -0400
commit8a79fc87840150f74a5b27f7811db67003bc0c32 (patch)
tree8fd4c056c7402ebab1245459c3d7fc1d774500eb /ui/widgets/controlgroup.js
parent3c860f95aa43c7844883f4417247d2aa6c482151 (diff)
downloadjquery-ui-8a79fc87840150f74a5b27f7811db67003bc0c32.tar.gz
jquery-ui-8a79fc87840150f74a5b27f7811db67003bc0c32.zip
Controlgroup: Add "only" position to class generator functions
Fixes #14972 Closes gh-1711
Diffstat (limited to 'ui/widgets/controlgroup.js')
-rw-r--r--ui/widgets/controlgroup.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/ui/widgets/controlgroup.js b/ui/widgets/controlgroup.js
index a79491bfb..5d2bbba83 100644
--- a/ui/widgets/controlgroup.js
+++ b/ui/widgets/controlgroup.js
@@ -152,7 +152,7 @@ return $.widget( "ui.controlgroup", {
},
_updateCornerClass: function( element, position ) {
- var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right";
+ var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
var add = this._buildSimpleOptions( position, "label" ).classes.label;
this._removeClass( element, null, remove );
@@ -167,7 +167,8 @@ return $.widget( "ui.controlgroup", {
result.classes[ key ] = {
"middle": "",
"first": "ui-corner-" + ( direction ? "top" : "left" ),
- "last": "ui-corner-" + ( direction ? "bottom" : "right" )
+ "last": "ui-corner-" + ( direction ? "bottom" : "right" ),
+ "only": "ui-corner-all"
}[ position ];
return result;
@@ -206,6 +207,10 @@ return $.widget( "ui.controlgroup", {
last: {
"ui-selectmenu-button-open": direction ? "" : "ui-corner-tr",
"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" )
+ },
+ only: {
+ "ui-selectmenu-button-open": "ui-corner-top",
+ "ui-selectmenu-button-closed": "ui-corner-all"
}
}[ position ]
@@ -261,7 +266,9 @@ return $.widget( "ui.controlgroup", {
var instance = children[ value ]().data( "ui-controlgroup-data" );
if ( instance && that[ "_" + instance.widgetName + "Options" ] ) {
- var options = that[ "_" + instance.widgetName + "Options" ]( value );
+ var options = that[ "_" + instance.widgetName + "Options" ](
+ children.length === 1 ? "only" : value
+ );
options.classes = that._resolveClassesValues( options.classes, instance );
instance.element[ instance.widgetName ]( options );
} else {