diff options
author | Patrick Klingemann <patrick.klingemann@gmail.com> | 2014-06-09 09:46:08 -0400 |
---|---|---|
committer | Patrick Klingemann <patrick.klingemann@gmail.com> | 2014-06-09 09:46:08 -0400 |
commit | 41f6d9b0607a97bd7c643609c62c4fd0d8be1780 (patch) | |
tree | f174a5c93e13d57f66a44c16f088ef870bc1856e /src | |
parent | 5fd4a57bfd339f01221d2b51abb03465012e7828 (diff) | |
download | svg.js-41f6d9b0607a97bd7c643609c62c4fd0d8be1780.tar.gz svg.js-41f6d9b0607a97bd7c643609c62c4fd0d8be1780.zip |
avoid unintentional global variables
Diffstat (limited to 'src')
-rwxr-xr-x | src/element.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/element.js b/src/element.js index bd7e55a..712bef2 100755 --- a/src/element.js +++ b/src/element.js @@ -343,7 +343,7 @@ SVG.Element = SVG.invent({ } // Return array of classes on the node , classes: function() { - classAttr = this.node.getAttribute('class') + var classAttr = this.node.getAttribute('class') if (classAttr === null) { return [] } else { @@ -356,6 +356,7 @@ SVG.Element = SVG.invent({ } // Add class to the node , addClass: function(className) { + var classArray if (!(this.hasClass(className))) { classArray = this.classes() classArray.push(className) @@ -365,6 +366,7 @@ SVG.Element = SVG.invent({ } // Remove class from the node , removeClass: function(className) { + var classArray if (this.hasClass(className)) { classArray = this.classes().filter(function(c) { return c != className |