summaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-02-05 17:48:03 +0100
committerwout <wout@impinc.co.uk>2013-02-05 17:48:03 +0100
commit11fab70a8066e5c7bb0be881b6abb6f90a5c47b0 (patch)
tree927ceceadf8c551b5fe692125c7b3bf57033fef4 /src/event.js
parent87dd4169a0315310cacefefc9b3157428f584c51 (diff)
downloadsvg.js-11fab70a8066e5c7bb0be881b6abb6f90a5c47b0.tar.gz
svg.js-11fab70a8066e5c7bb0be881b6abb6f90a5c47b0.zip
Unbinding an event from an element
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/event.js b/src/event.js
index d2222bf..a2bb3f0 100644
--- a/src/event.js
+++ b/src/event.js
@@ -20,11 +20,11 @@
/* add event to SVG.Element */
SVG.Element.prototype[event] = function(f) {
var self = this;
-
+
/* bind event to element rather than element node */
- this.node['on' + event] = function() {
- return f.apply(self, arguments);
- };
+ this.node['on' + event] = typeof f == 'function'
+ ? function() { return f.apply(self, arguments); }
+ : null;
return this;
};