mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Prevent inputs with unnecessary data-role button from being double enhanced
This commit is contained in:
parent
956075cbff
commit
fcbc042e84
1 changed files with 3 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue