Permalink
Browse files

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

…hanced
  • Loading branch information...
1 parent 8cc4ea3 commit 7a7882288668d250f7b80c635674aefbc878e8ba Josh Dean committed with gseguin Jan 17, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 js/jquery.mobile.buttonMarkup.js
@@ -29,6 +29,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 7a78822

Please sign in to comment.