Skip to content

Commit db28688

Browse files
author
Scott Jehl
committed
Merge pull request jquery-archive#4363 from uGoMobi/issue_#3998
Fixes jquery-archive#3998 - All buttons, regardless of markup, should be mini by default in toolbars
2 parents 5a986d2 + 7484654 commit db28688

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

css/structure/jquery.mobile.button.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
.ui-header .ui-btn,
99
.ui-footer .ui-btn { display: inline-block; margin: 0; }
10+
.ui-header .ui-btn-block,
11+
.ui-footer .ui-btn-block { display: block; margin: .25em 5px; }
12+
.ui-header .ui-btn-block.ui-fullsize,
13+
.ui-footer .ui-btn-block.ui-fullsize { margin: .5em 5px; }
1014

1115
.ui-header .ui-btn-inner,
1216
.ui-footer .ui-btn-inner,

js/jquery.mobile.buttonMarkup.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,19 @@ $.fn.buttonMarkup = function( options ) {
7070
}
7171

7272
buttonClass = "ui-btn ui-btn-up-" + o.theme;
73-
buttonClass += o.inline ? " ui-btn-inline" : "";
7473
buttonClass += o.shadow ? " ui-shadow" : "";
7574
buttonClass += o.corners ? " ui-btn-corner-all" : "";
7675

7776
if ( o.mini !== undefined ) {
7877
// Used to control styling in headers/footers, where buttons default to `mini` style.
79-
buttonClass += o.mini ? " ui-mini" : " ui-fullsize";
78+
buttonClass += o.mini === true ? " ui-mini" : " ui-fullsize";
8079
}
8180

8281
if ( o.inline !== undefined ) {
83-
// Used to control styling in headers/footers, where buttons default to `mini` style.
84-
buttonClass += o.inline === false ? " ui-btn-block" : " ui-btn-inline";
82+
// Used to control styling in headers/footers, where buttons default to `inline` style.
83+
buttonClass += o.inline === true ? " ui-btn-inline" : " ui-btn-block";
8584
}
8685

87-
8886
if ( o.icon ) {
8987
o.icon = "ui-icon-" + o.icon;
9088
o.iconpos = o.iconpos || "left";
@@ -241,7 +239,7 @@ var attachEvents = function() {
241239
$( document ).bind( "pagecreate create", function( e ){
242240

243241
$( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target )
244-
.not( ".ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" )
242+
.not( "button, input, .ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" )
245243
.buttonMarkup();
246244
});
247245

js/jquery.mobile.forms.button.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ $.widget( "mobile.button", $.mobile.widget, {
1313
theme: null,
1414
icon: null,
1515
iconpos: null,
16-
inline: false,
1716
corners: true,
1817
shadow: true,
1918
iconshadow: true,
20-
initSelector: "button, [type='button'], [type='submit'], [type='reset'], [type='image']",
21-
mini: false
19+
initSelector: "button, [type='button'], [type='submit'], [type='reset'], [type='image']"
2220
},
2321
_create: function() {
2422
var $el = this.element,
2523
$button,
2624
o = this.options,
2725
type,
2826
name,
27+
inline = o.inline || $el.jqmData( "inline" ),
28+
mini = o.mini || $el.jqmData( "mini" ),
2929
classes = "",
3030
$buttonPlaceholder;
3131

@@ -64,11 +64,11 @@ $.widget( "mobile.button", $.mobile.widget, {
6464
theme: o.theme,
6565
icon: o.icon,
6666
iconpos: o.iconpos,
67-
inline: o.inline,
67+
inline: inline,
6868
corners: o.corners,
6969
shadow: o.shadow,
7070
iconshadow: o.iconshadow,
71-
mini: o.mini
71+
mini: mini
7272
})
7373
.addClass( classes )
7474
.append( $el.addClass( "ui-btn-hidden" ) );

0 commit comments

Comments
 (0)