Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed $.inArray to indexOf in closestEnabledButton - see http://jsp…

  • Loading branch information...
commit f3f5ba62e542a987ea92c02f993a91beeb6c61d6 1 parent e918442
@hpbuniat hpbuniat authored
Showing with 4 additions and 6 deletions.
  1. +4 −6 js/jquery.mobile.buttonMarkup.js
View
10 js/jquery.mobile.buttonMarkup.js 100644 → 100755
@@ -6,7 +6,6 @@
$.fn.buttonMarkup = function( options ) {
options = options || {};
-
for ( var i = 0; i < this.length; i++ ) {
var el = this.eq( i ),
e = el[ 0 ],
@@ -92,7 +91,7 @@ $.fn.buttonMarkup = function( options ) {
}
e.appendChild( buttonInner );
-
+
// TODO obviously it would be nice to pull this element out instead of
// retrieving it from the DOM again, but this change is much less obtrusive
// and 1.0 draws nigh
@@ -118,12 +117,11 @@ function closestEnabledButton( element ) {
// handed could be in an SVG DOM where className on SVG elements is defined to
// be of a different type (SVGAnimatedString). We only operate on HTML DOM
// elements, so we look for plain "string".
-
- cname = ( typeof element.className === 'string' ) && element.className.split(' ');
-
- if ( cname && $.inArray( "ui-btn", cname ) > -1 && $.inArray( "ui-disabled", cname ) < 0 ) {
+ cname = ( typeof element.className === 'string' ) && (element.className + ' ');
+ if ( cname && cname.indexOf("ui-btn ") > -1 && cname.indexOf("ui-disabled ") < 0 ) {
break;
}
+
element = element.parentNode;
}
Please sign in to comment.
Something went wrong with that request. Please try again.