Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 69699d0

Browse files
committed
Button: check to ensure icon is set before applying icon position class Fixes #6212 - Button text not correctly aligned to center
1 parent de3d36a commit 69699d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

js/widgets/forms/button.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ $.widget( "mobile.button", {
5555
},
5656

5757
_button: function() {
58-
return $("<div class='ui-btn ui-input-btn " +
59-
this.options.wrapperClass +
60-
" ui-btn-" + this.options.theme +
58+
return $("<div class='ui-btn ui-input-btn" +
59+
( this.options.wrapperClass ? " " + this.options.wrapperClass : "" ) +
60+
( this.options.theme ? " ui-btn-" + this.options.theme : "" ) +
6161
( this.options.corners ? " ui-corner-all" : "" ) +
6262
( this.options.shadow ? " ui-shadow" : "" ) +
6363
( this.options.inline ? " ui-btn-inline" : "" ) +
6464
( this.options.mini ? " ui-mini" : "" ) +
6565
( this.options.disabled ? " ui-disabled" : "" ) +
66-
( this.options.iconpos ? " ui-btn-icon-" + this.options.iconpos : ( this.options.icon ? " ui-btn-icon-left" : "" ) ) +
66+
( ( this.options.iconpos && this.options.icon ) ? " ui-btn-icon-" + this.options.iconpos : ( this.options.icon ? " ui-btn-icon-left" : "" ) ) +
6767
( this.options.icon ? "ui-icon-" + this.options.icon : "" ) +
6868
"' >" + this.element.val() + "</div>");
6969
},

0 commit comments

Comments
 (0)