aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick Klingemann <patrick.klingemann@gmail.com>2014-06-09 09:46:08 -0400
committerPatrick Klingemann <patrick.klingemann@gmail.com>2014-06-09 09:46:08 -0400
commit41f6d9b0607a97bd7c643609c62c4fd0d8be1780 (patch)
treef174a5c93e13d57f66a44c16f088ef870bc1856e /src
parent5fd4a57bfd339f01221d2b51abb03465012e7828 (diff)
downloadsvg.js-41f6d9b0607a97bd7c643609c62c4fd0d8be1780.tar.gz
svg.js-41f6d9b0607a97bd7c643609c62c4fd0d8be1780.zip
avoid unintentional global variables
Diffstat (limited to 'src')
-rwxr-xr-xsrc/element.js4
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