aboutsummaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-30 18:53:18 +0100
committerwout <wout@impinc.co.uk>2012-12-30 18:53:18 +0100
commitcfabe5671d91b9f2acd000cdd4803fd014bfef2d (patch)
treedc84e6416ffd215ce4bcccf80d12918a6550e8fd /src/event.js
parentf6724c34bfdd5d3e207b4fc395d988de617b2b94 (diff)
downloadsvg.js-cfabe5671d91b9f2acd000cdd4803fd014bfef2d.tar.gz
svg.js-cfabe5671d91b9f2acd000cdd4803fd014bfef2d.zip
Added dblclick to event.js
Diffstat (limited to 'src/event.js')
-rw-r--r--src/event.js9
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