]> source.dussan.org Git - jquery-ui.git/commitdiff
Controlgroup: Fixes for spinner
authorAlexander Schmitz <arschmitz@gmail.com>
Mon, 17 Aug 2015 12:43:31 +0000 (08:43 -0400)
committerAlexander Schmitz <arschmitz@gmail.com>
Thu, 8 Oct 2015 18:02:47 +0000 (14:02 -0400)
demos/controlgroup/default.html
themes/base/controlgroup.css
ui/widgets/controlgroup.js

index ba7802cde333a73eb9dbe38b4e3cb5cde9e7626f..0c26bd6cdda36365629acc3c0eaa72e12e6eef33 100644 (file)
@@ -26,7 +26,6 @@
                $( ".controlgroup-vertical" ).controlgroup({
                        "direction": "vertical"
                });
-               $( ".button" ).button();
        </script>
 </head>
 <body>
@@ -34,7 +33,6 @@
        <h1>Controlgroup</h1>
        <fieldset>
                <legend>Rental Car</legend>
-               <button class="button">button</button>
                <div class="controlgroup">
                        <select id="car-type">
                                <option>Compact car</option>
index 311b723cc8d69cf525baba21ff7b084b28dc8dfd..bda376deb42eac5fb0e0221ee967ac80cb7c0973 100644 (file)
        box-sizing: border-box;
 }
 .ui-controlgroup .ui-controlgroup-label {
-       font-size: .83em;
-       padding: .6em 1em;
+       padding: .4em 1em;
+}
+.ui-controlgroup .ui-controlgroup-label span {
+       font-size: 80%;
 }
 .ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
        border-left: none;
 .ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
        border-right: none;
 }
+.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
+       border-bottom: none;
+}
+
+/* Spinner specific style fixes */
+.ui-controlgroup-vertical .ui-spinner {
+       padding-right: .4em;
+}
+.ui-controlgroup-vertical .ui-spinner-input {
+       margin: .4em;
+       padding: 0;
+
+       /* Support IE8, Android < 4.4 */
+       width: 85%;
+       width: calc( 100% - 22px );
+}
+.ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
+       border-top-style: solid;
+}
+
index 4e68ad7a8cf4103589433bbb578c40056a804d1c..c895ab09ef3f7e88a39e4068794a77921213a202 100644 (file)
@@ -97,6 +97,9 @@ return $.widget( "ui.controlgroup", {
                                } );
                        } else if ( selector && widget === "controlgroupLabel" ) {
                                labels = that.element.find( selector );
+                               labels.each( function() {
+                                       $( this ).contents().wrapAll( "<span class='ui-controlgroup-label-contents'></span>" );
+                               } );
                                that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" );
                                Array.prototype.push.apply( childWidgets, labels.get() );
                        }
@@ -117,9 +120,9 @@ return $.widget( "ui.controlgroup", {
        },
 
        _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;
+               var direction = this.options.direction === "vertical"
+                       remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right",
+                       add = this._buildSimpleOptions( position, direction, "label" ).classes.label;
 
                this._removeClass( element, null, remove );
                this._addClass( element, null, add );
@@ -219,7 +222,7 @@ return $.widget( "ui.controlgroup", {
                        $.each( [ "first", "last" ], function( index, value ) {
                                var instance = children[ value ]().data( "ui-controlgroup-data" );
 
-                               if ( that[ "_" + instance.widgetName + "_options" ] ) {
+                               if ( instance && that[ "_" + instance.widgetName + "_options" ] ) {
                                        instance.element[ instance.widgetName ](
                                                that[ "_" + instance.widgetName + "_options" ](
                                                        value,