Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Bug fix for #3141: Prevent inputs with unnecessary data-role button from being double enhanced #3442

Merged
merged 1 commit into from

2 participants

@imjoshdean

No description provided.

@gseguin
Collaborator

Looks like this is already fixed by commit c0dbecc which I just merged to 1.0-stable

@gseguin gseguin closed this
@gseguin gseguin reopened this
@gseguin gseguin merged commit ed124bf into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 17, 2012
This page is out of date. Refresh to see the latest.
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();
Something went wrong with that request. Please try again.