Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix for #3141 - redirect from button() and buttonMarkup() to correct …

…function for element
  • Loading branch information...
commit c0dbecc8558b2ab08e7938aeeab29a6e368f1acc 1 parent 2ba27e0
Garann Means garann authored
6 js/jquery.mobile.buttonMarkup.js
View
@@ -30,6 +30,12 @@ $.fn.buttonMarkup = function( options ) {
buttonText = document.createElement( o.wrapperEls ),
buttonIcon = o.icon ? document.createElement( "span" ) : null;
+ // 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();
+ continue;
+ }
+
if ( attachEvents ) {
attachEvents();
}
8 js/jquery.mobile.forms.button.js
View
@@ -19,12 +19,18 @@ $.widget( "mobile.button", $.mobile.widget, {
},
_create: function() {
var $el = this.element,
- $button,
+ $button,
o = this.options,
type,
name,
$buttonPlaceholder;
+ // if this is a link, check if it's been enhanced and, if not, use the right function
+ if( $el[ 0 ].tagName === "A" ) {
+ if ( !$el.hasClass( "ui-btn" ) ) $el.buttonMarkup();
+ return;
+ }
+
// Add ARIA role
this.button = $( "<div></div>" )
.text( $el.text() || $el.val() )
Please sign in to comment.
Something went wrong with that request. Please try again.