Merge pull request #3442 from imjoshdean/master

Bug fix for #3141: Prevent inputs with unnecessary data-role button from being double enhanced
This commit is contained in:
Ghislain Seguin 2012-01-18 15:59:41 -08:00
commit ed124bf237

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