From fcbc042e84ad95d1150c2ed5b173068e6b5934ba Mon Sep 17 00:00:00 2001 From: Josh Dean Date: Mon, 16 Jan 2012 18:23:14 -0600 Subject: [PATCH] Prevent inputs with unnecessary data-role button from being double enhanced --- js/jquery.mobile.buttonMarkup.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/jquery.mobile.buttonMarkup.js b/js/jquery.mobile.buttonMarkup.js index 6a5282d5..97af33e8 100755 --- a/js/jquery.mobile.buttonMarkup.js +++ b/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();