Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…hanced
  • Loading branch information...
commit fcbc042e84ad95d1150c2ed5b173068e6b5934ba 1 parent 956075c
Josh Dean authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  js/jquery.mobile.buttonMarkup.js
View
3  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();
Please sign in to comment.
Something went wrong with that request. Please try again.