Permalink
Browse files

Mini styling for navbar with adjusted padding top and bottom. Set rig…

…ht border on last button when not in toolbar.
  • Loading branch information...
1 parent c25f9e4 commit 54d1a11db640e4e88d8804a53501fd0907943b94 @jaspermdegroot jaspermdegroot committed Jun 12, 2012
Showing with 16 additions and 9 deletions.
  1. +14 −4 css/structure/jquery.mobile.navbar.css
  2. +1 −0 js/jquery.mobile.grid.js
  3. +1 −5 js/widgets/navbar.js
@@ -3,6 +3,17 @@
.ui-navbar li .ui-btn { display: block; text-align: center; margin: 0 -1px 0 0; border-right-width: 0; }
.ui-navbar li .ui-btn-icon-right .ui-icon { right: 6px; }
+/* add border if not in header/footer (full width) */
+.ui-navbar li:last-child .ui-btn,
+.ui-navbar .ui-grid-duo .ui-block-b .ui-btn { margin-right: 0; border-right-width: 1px; }
+.ui-header .ui-navbar li:last-child .ui-btn,
+.ui-footer .ui-navbar li:last-child .ui-btn,
+.ui-header .ui-navbar .ui-grid-duo .ui-block-b .ui-btn,
+.ui-footer .ui-navbar .ui-grid-duo .ui-block-b .ui-btn { margin-right: -1px; border-right-width: 0; }
+.ui-navbar .ui-grid-duo li.ui-block-a:last-child .ui-btn { margin-right: -1px; border-right-width: 1px; }
+.ui-header .ui-navbar li .ui-btn,
+.ui-footer .ui-navbar li .ui-btn { border-top-width: 0; border-bottom-width: 0; }
+
/* fixing gaps caused by subpixel problem */
.ui-header .ui-navbar .ui-grid-b li.ui-block-c .ui-btn,
.ui-footer .ui-navbar .ui-grid-b li.ui-block-c .ui-btn { margin-right: -5px; }
@@ -15,7 +26,6 @@
.ui-header .ui-navbar .ui-grid-d li.ui-block-e .ui-btn-icon-right .ui-icon,
.ui-footer .ui-navbar .ui-grid-d li.ui-block-e .ui-btn-icon-right .ui-icon { right: 7px; }
-.ui-header .ui-navbar li .ui-btn,
-.ui-footer .ui-navbar li .ui-btn { border-top-width: 0; border-bottom-width: 0; }
-.ui-navbar .ui-btn-inner { padding-left: 2px; padding-right: 2px; }
-.ui-navbar-noicons li .ui-btn .ui-btn-inner { padding-top: .8em; padding-bottom: .9em; }
+.ui-navbar li .ui-btn .ui-btn-inner { padding-top: .7em; padding-bottom: .8em }
+.ui-navbar li .ui-btn-icon-top .ui-btn-inner { padding-top: 30px; }
+.ui-navbar li .ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 30px; }
View
@@ -30,6 +30,7 @@ $.fn.grid = function( options ) {
}
} else {
grid = "a";
+ $this.addClass( "ui-grid-duo" );
}
}
iterator = gridCols[grid];
View
@@ -24,16 +24,12 @@ $.widget( "mobile.navbar", $.mobile.widget, {
iconpos = $navbtns.filter( ":jqmData(icon)" ).length ?
this.options.iconpos : undefined;
- $navbar.addClass( "ui-navbar" )
+ $navbar.addClass( "ui-navbar ui-mini" )
.attr( "role","navigation" )
.find( "ul" )
.jqmEnhanceable()
.grid({ grid: this.options.grid });
- if ( !iconpos ) {
- $navbar.addClass( "ui-navbar-noicons" );
- }
-
$navbtns.buttonMarkup({
corners: false,
shadow: false,

1 comment on commit 54d1a11

Member

jaspermdegroot commented on 54d1a11 Jun 16, 2012

part of PR #4514

Please sign in to comment.