diff options
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/event.js b/src/event.js index 6a9c3e3..ca1d290 100644 --- a/src/event.js +++ b/src/event.js @@ -1,15 +1,20 @@ -var eventTypes = ['click', 'mousedown', 'mouseup', 'mouseover', 'mouseout', 'mousemove']; +var eventTypes = ['click', 'dblclick', 'mousedown', 'mouseup', 'mouseover', 'mouseout', 'mousemove']; // generate events for (var i = eventTypes.length - 1; i >= 0; i--) { var t = eventTypes[i]; + + // add event to SVG.Elment SVG.Element.prototype[t] = function(f) { var e = this; + + // bind event to element rather than element node this.node['on' + t] = function() { return f.apply(e, arguments); }; - return e; + // return self + return this; }; };
\ No newline at end of file |