Prevent inputs with unnecessary data-role button from being double enhanced

This commit is contained in:
Josh Dean 2012-01-16 18:23:14 -06:00
parent 956075cbff
commit fcbc042e84

View file

@ -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();