Permalink
Browse files

Update to buttonMarkup to use appropriate data selector

  • Loading branch information...
1 parent e4453ac commit a23f0d3a0e0512b4bfcb9aa01b51e5eb39259cf3 Josh Dean committed with gseguin Jan 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 js/jquery.mobile.buttonMarkup.js
@@ -31,8 +31,8 @@ $.fn.buttonMarkup = function( options ) {
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( e.tagName === "INPUT" && el.jqmData('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();

2 comments on commit a23f0d3

@ninichki

Is it right, that the name is "el" instead of "e"?

@imjoshdean

Yep. "el" is the jQuery object for the element. You can't rely on the attribute being "data-role" 100% of the time, you have to use the jqmData function.

Please sign in to comment.