Permalink
Browse files

Float left instead of display inline-block for all buttons in horizon…

…tal controlgroup.
  • Loading branch information...
1 parent e6dda68 commit 68f4ab6857c1946b32933d35de7e865c9c20df59 @jaspermdegroot jaspermdegroot committed Jun 7, 2012
Showing with 9 additions and 3 deletions.
  1. +7 −2 css/structure/jquery.mobile.controlgroup.css
  2. +2 −1 js/jquery.mobile.controlGroup.js
@@ -11,9 +11,14 @@
.ui-controlgroup-controls label.ui-select { position: absolute; left: -9999px; }
.ui-controlgroup-vertical .ui-controlgroup-last { border-bottom-width: 1px; }
-.ui-controlgroup-horizontal .ui-btn-inner { text-align:center; }
-.ui-controlgroup-horizontal .ui-btn, .ui-controlgroup-horizontal .ui-select { display: inline-block; margin: 0 -6px 0 0; }
+.ui-controlgroup-horizontal .ui-controlgroup-controls:before,
+.ui-controlgroup-horizontal .ui-controlgroup-controls:after { content: ""; display: table; }
+.ui-controlgroup-horizontal .ui-controlgroup-controls:after { clear: both; }
+.ui-controlgroup-horizontal .ui-controlgroup-controls { zoom: 1; }
+.ui-controlgroup-horizontal .ui-btn-inner { text-align: center; }
+.ui-controlgroup-horizontal .ui-btn, .ui-controlgroup-horizontal .ui-select,
.ui-controlgroup-horizontal .ui-checkbox, .ui-controlgroup-horizontal .ui-radio { float: left; clear: none; margin: 0 -1px 0 0; }
+.ui-controlgroup-horizontal .ui-select .ui-btn,
.ui-controlgroup-horizontal .ui-checkbox .ui-btn, .ui-controlgroup-horizontal .ui-radio .ui-btn,
.ui-controlgroup-horizontal .ui-checkbox:last-child, .ui-controlgroup-horizontal .ui-radio:last-child { margin-right: 0; }
.ui-controlgroup-horizontal .ui-controlgroup-last { margin-right: 0; }
@@ -28,10 +28,11 @@ $.fn.controlgroup = function( options ) {
groupheading = $el.children( "legend" ),
flCorners = o.direction == "horizontal" ? [ "ui-corner-left", "ui-corner-right" ] : [ "ui-corner-top", "ui-corner-bottom" ],
type = $el.find( "input" ).first().attr( "type" );
+
+ $el.wrapInner( "<div class='ui-controlgroup-controls'></div>" );
// Replace legend with more stylable replacement div
if ( groupheading.length ) {
- $el.wrapInner( "<div class='ui-controlgroup-controls'></div>" );
$( "<div role='heading' class='ui-controlgroup-label'>" + groupheading.html() + "</div>" ).insertBefore( $el.children(0) );
groupheading.remove();
}

0 comments on commit 68f4ab6

Please sign in to comment.