Permalink
Browse files

Merge pull request #4363 from uGoMobi/issue_#3998

Fixes #3998 - All buttons, regardless of markup, should be mini by default in toolbars
  • Loading branch information...
1 parent 4133bf4 commit 219c5a620769527ae8897ff5f4261cf98b742804 @jaspermdegroot jaspermdegroot committed Jul 10, 2012
Showing with 9 additions and 11 deletions.
  1. +4 −6 js/jquery.mobile.buttonMarkup.js
  2. +5 −5 js/jquery.mobile.forms.button.js
View
10 js/jquery.mobile.buttonMarkup.js
@@ -71,21 +71,19 @@ $.fn.buttonMarkup = function( options ) {
}
buttonClass = "ui-btn ui-btn-up-" + o.theme;
- buttonClass += o.inline ? " ui-btn-inline" : "";
buttonClass += o.shadow ? " ui-shadow" : "";
buttonClass += o.corners ? " ui-btn-corner-all" : "";
if ( o.mini !== undefined ) {
// Used to control styling in headers/footers, where buttons default to `mini` style.
- buttonClass += o.mini ? " ui-mini" : " ui-fullsize";
+ buttonClass += o.mini === true ? " ui-mini" : " ui-fullsize";
}
if ( o.inline !== undefined ) {
- // Used to control styling in headers/footers, where buttons default to `mini` style.
- buttonClass += o.inline === false ? " ui-btn-block" : " ui-btn-inline";
+ // Used to control styling in headers/footers, where buttons default to `inline` style.
+ buttonClass += o.inline === true ? " ui-btn-inline" : " ui-btn-block";
}
-
if ( o.icon ) {
o.icon = "ui-icon-" + o.icon;
o.iconpos = o.iconpos || "left";
@@ -242,7 +240,7 @@ var attachEvents = function() {
$( document ).bind( "pagecreate create", function( e ){
$( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target )
- .not( ".ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" )
+ .not( "button, input, .ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" )
.buttonMarkup();
});
View
10 js/jquery.mobile.forms.button.js
@@ -14,19 +14,19 @@ $.widget( "mobile.button", $.mobile.widget, {
theme: null,
icon: null,
iconpos: null,
- inline: false,
corners: true,
shadow: true,
iconshadow: true,
- initSelector: "button, [type='button'], [type='submit'], [type='reset'], [type='image']",
- mini: false
+ initSelector: "button, [type='button'], [type='submit'], [type='reset'], [type='image']"
},
_create: function() {
var $el = this.element,
$button,
o = this.options,
type,
name,
+ inline = o.inline || $el.jqmData( "inline" ),
+ mini = o.mini || $el.jqmData( "mini" ),
classes = "",
$buttonPlaceholder;
@@ -67,11 +67,11 @@ $.widget( "mobile.button", $.mobile.widget, {
theme: o.theme,
icon: o.icon,
iconpos: o.iconpos,
- inline: o.inline,
+ inline: inline,
corners: o.corners,
shadow: o.shadow,
iconshadow: o.iconshadow,
- mini: o.mini
+ mini: mini
})
.addClass( classes )
.append( $el.addClass( "ui-btn-hidden" ) );

0 comments on commit 219c5a6

Please sign in to comment.