aboutsummaryrefslogtreecommitdiffstats
path: root/src/eventtarget.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/eventtarget.js')
-rw-r--r--src/eventtarget.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/eventtarget.js b/src/eventtarget.js
new file mode 100644
index 0000000..fbe4781
--- /dev/null
+++ b/src/eventtarget.js
@@ -0,0 +1,23 @@
+SVG.EventTarget = SVG.invent({
+ create: function () {},
+ extend: {
+ // Bind given event to listener
+ on: function (event, listener, binding, options) {
+ SVG.on(this, event, listener, binding, options)
+ return this
+ },
+ // Unbind event from listener
+ off: function (event, listener) {
+ SVG.off(this, event, listener)
+ return this
+ },
+ dispatch: function (event, data) {
+ return SVG.dispatch(this, event, data)
+ },
+ // Fire given event
+ fire: function (event, data) {
+ this.dispatch(event, data)
+ return this
+ }
+ }
+})