#car-type-button {
width: 120px;
}
- .ui-controlgroup-horizontal .ui-spinner {
- width: 50px;
+ .ui-controlgroup-horizontal .ui-spinner-input {
+ width: 20px;
}
</style>
<script src="../../external/requirejs/require.js"></script>
$( ".controlgroup-vertical" ).controlgroup({
"direction": "vertical"
});
+ $( ".button" ).button();
</script>
</head>
<body>
<h1>Controlgroup</h1>
<fieldset>
<legend>Rental Car</legend>
+ <button class="button">button</button>
<div class="controlgroup">
<select id="car-type">
<option>Compact car</option>
items: {
"button": "input[type=button], input[type=submit], input[type=reset], button, a",
"checkboxradio": "input[type='checkbox'], input[type='radio']",
- "selectmenu": "select"
+ "selectmenu": "select",
+ "spinner": ".ui-spinner-input",
+ "controlgroupLabel": ".ui-controlgroup-label"
},
direction: "horizontal",
excludeInvisible: true,
// Make sure the widget actually exists and has a selector set
if ( $.fn[ widget ] && selector ) {
- // Find instances of this widget inside controlgroup and run method or set options
+ // Find instances of this widget inside controlgroup and set options
widgets = that.element.find( selector )[ widget ]( options );
- // Don't set data or add to the collection if the method is destroy
widgets.each( function() {
- var element = $( this );
+ var element = $( this ),
// Set data on the widget element pointing to the this.element of the widget
// and telling us what type of widget this is
- var widgetElement =
- element[ widget ]( "widget" ).data( "ui-controlgroup-data", element.data( "ui-" +
- widget.charAt(0).toUpperCase() + widget.slice(1) ) );
+ widgetElement = element[ widget ]( "widget" ).data(
+ "ui-controlgroup-data",
+ element.data( "ui-" + widget.charAt(0).toUpperCase() + widget.slice(1) )
+ );
childWidgets.push( widgetElement[ 0 ] );
} );
} else if ( selector && widget === "controlgroupLabel" ) {
labels = that.element.find( selector );
that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" );
- Array.prototype.push.apply( childWidgets, labels );
+ Array.prototype.push.apply( childWidgets, labels.get() );
}
} );
} );
},
+ _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;
+
+ this._removeClass( element, null, remove );
+ this._addClass( element, null, add );
+ },
+
_buildSimpleOptions: function( position, direction, key ) {
var result = {
classes: {}
that.options.direction === "vertical"
)
);
+ } else {
+ that._updateCornerClass( children[ value ](), value );
}
} );