Skip to content
This repository
Browse code

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

…hanced
  • Loading branch information...
commit 7a7882288668d250f7b80c635674aefbc878e8ba 1 parent 8cc4ea3
authored January 16, 2012 gseguin committed January 18, 2012

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. 3  js/jquery.mobile.buttonMarkup.js
3  js/jquery.mobile.buttonMarkup.js
@@ -29,6 +29,9 @@ $.fn.buttonMarkup = function( options ) {
29 29
 			buttonText = document.createElement( o.wrapperEls ),
30 30
 			buttonIcon = o.icon ? document.createElement( "span" ) : null;
31 31
 
  32
+		// if so, prevent double enhancement, and continue with rest of the elements.
  33
+		if( e.tagName === "INPUT" && e.getAttribute( "data-role" ) === "button" ) continue;
  34
+
32 35
 		// if this is a button, check if it's been enhanced and, if not, use the right function
33 36
 		if( e.tagName === "BUTTON" ) {
34 37
 	 	 	if ( !$( e.parentNode ).hasClass( "ui-btn" ) ) $( e ).button();

0 notes on commit 7a78822

Please sign in to comment.
Something went wrong with that request. Please try again.