Permalink
Browse files

Button: check to ensure icon is set before applying icon position class

Fixes #6212 - Button text not correctly aligned to center
  • Loading branch information...
arschmitz committed Jul 29, 2013
1 parent de3d36a commit 69699d00faaff979241f5e90f1399ef6a7ca8d80
Showing with 4 additions and 4 deletions.
  1. +4 −4 js/widgets/forms/button.js
@@ -55,15 +55,15 @@ $.widget( "mobile.button", {
},
_button: function() {
return $("<div class='ui-btn ui-input-btn " +
this.options.wrapperClass +
" ui-btn-" + this.options.theme +
return $("<div class='ui-btn ui-input-btn" +
( this.options.wrapperClass ? " " + this.options.wrapperClass : "" ) +
( this.options.theme ? " ui-btn-" + this.options.theme : "" ) +
( this.options.corners ? " ui-corner-all" : "" ) +
( this.options.shadow ? " ui-shadow" : "" ) +
( this.options.inline ? " ui-btn-inline" : "" ) +
( this.options.mini ? " ui-mini" : "" ) +
( this.options.disabled ? " ui-disabled" : "" ) +
( this.options.iconpos ? " ui-btn-icon-" + this.options.iconpos : ( this.options.icon ? " ui-btn-icon-left" : "" ) ) +
( ( this.options.iconpos && this.options.icon ) ? " ui-btn-icon-" + this.options.iconpos : ( this.options.icon ? " ui-btn-icon-left" : "" ) ) +
( this.options.icon ? "ui-icon-" + this.options.icon : "" ) +
"' >" + this.element.val() + "</div>");
},

0 comments on commit 69699d0

Please sign in to comment.