Permalink
Browse files

Merge pull request #3442 from imjoshdean/master

Bug fix for #3141: Prevent inputs with unnecessary data-role button from being double enhanced
  • Loading branch information...
gseguin committed Jan 18, 2012
2 parents 96d339e + fcbc042 commit ed124bf2378f244b745c7872f0ee573ab4555924
Showing with 3 additions and 0 deletions.
  1. +3 −0 js/jquery.mobile.buttonMarkup.js
@@ -30,6 +30,9 @@ $.fn.buttonMarkup = function( options ) {
buttonText = document.createElement( o.wrapperEls ),
buttonIcon = o.icon ? document.createElement( "span" ) : null;
+ // if so, prevent double enhancement, and continue with rest of the elements.
+ if( e.tagName === "INPUT" && e.getAttribute( "data-role" ) === "button" ) continue;
+
// if this is a button, check if it's been enhanced and, if not, use the right function
if( e.tagName === "BUTTON" ) {
if ( !$( e.parentNode ).hasClass( "ui-btn" ) ) $( e ).button();

0 comments on commit ed124bf

Please sign in to comment.