Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes #3141 - redirect from button() and buttonMarkup() to correct fu…

…nction for element
  • Loading branch information...
commit f0849afac6ceb46b41705735f78bd6d3c8e2fcbd 1 parent 26c1d8e
Garann Means garann authored gseguin committed
6 js/jquery.mobile.buttonMarkup.js
View
@@ -29,6 +29,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();
}
7 js/jquery.mobile.forms.button.js
View
@@ -17,11 +17,18 @@ $.widget( "mobile.button", $.mobile.widget, {
},
_create: function() {
var $el = this.element,
+ $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.