Skip to content

Commit 5b4b984

Browse files
author
Gabriel Schulhof
committed
Controlgroup: Account for default classes options when creating children
1 parent 60d9ae4 commit 5b4b984

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ui/widgets/controlgroup.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,17 @@ return $.widget( "ui.controlgroup", {
117117
.each( function() {
118118
var element = $( this );
119119
var instance = element[ widget ]( "instance" );
120+
var defaultInstance = instance || ( $.fn[ widget ].widgetConstructor &&
121+
$.fn[ widget ].widgetConstructor.prototype );
120122
var instanceOptions = $.widget.extend( {}, options );
121123

122124
// If the button is the child of a spinner ignore it
123125
if ( widget === "button" && element.parent( ".ui-spinner" ).length ) {
124126
return;
125127
}
126-
if ( instance ) {
128+
if ( defaultInstance ) {
127129
instanceOptions.classes =
128-
that._resolveClassesValues( instanceOptions.classes, instance );
130+
that._resolveClassesValues( instanceOptions.classes, defaultInstance );
129131
}
130132
element[ widget ]( instanceOptions );
131133

0 commit comments

Comments
 (0)