Permalink
Browse files

Prevent inputs with unnecessary data-role button from being double en…

…hanced
  • Loading branch information...
1 parent 956075c commit fcbc042e84ad95d1150c2ed5b173068e6b5934ba Josh Dean committed Jan 17, 2012
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 fcbc042

Please sign in to comment.