diff options
author | wout <wout@impinc.co.uk> | 2013-02-05 17:48:03 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-02-05 17:48:03 +0100 |
commit | 11fab70a8066e5c7bb0be881b6abb6f90a5c47b0 (patch) | |
tree | 927ceceadf8c551b5fe692125c7b3bf57033fef4 /src/event.js | |
parent | 87dd4169a0315310cacefefc9b3157428f584c51 (diff) | |
download | svg.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.js | 8 |
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; }; |