Skip to content

Commit

Permalink
make hasClass() compatible with SVG DOM where SVGAnimatedString is used
Browse files Browse the repository at this point in the history
  • Loading branch information
David Durman committed Apr 5, 2012
1 parent e0fd490 commit 6bb982f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/zepto.js
Expand Up @@ -343,7 +343,7 @@ var Zepto = (function() {
},
hasClass: function(name){
if (this.length < 1) return false;
else return classRE(name).test(this[0].className);
else return classRE(name).test(this[0].className.baseVal === undefined ? this[0].className : this[0].className.baseVal);
},
addClass: function(name){
return this.each(function(idx) {
Expand Down

0 comments on commit 6bb982f

Please sign in to comment.