summaryrefslogtreecommitdiffstats
path: root/src/event.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/event.js')
-rwxr-xr-xsrc/event.js17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/event.js b/src/event.js
index 63764ed..d7a83b2 100755
--- a/src/event.js
+++ b/src/event.js
@@ -27,15 +27,11 @@
})
-// Initialize events and listeners stack
-SVG.events = {}
+// Initialize listeners stack
SVG.listeners = {}
-// Event constructor
-SVG.registerEvent = function(event) {
- if (!SVG.events[event])
- SVG.events[event] = new CustomEvent(event)
-}
+// Only kept for consistency of API
+SVG.registerEvent = function(){};
// Add event binder in the SVG namespace
SVG.on = function(node, event, listener) {
@@ -100,14 +96,9 @@ SVG.extend(SVG.Element, {
}
// Fire given event
, fire: function(event, data) {
- // Add detail data to event
- SVG.events[event].detail = data
// Dispatch event
- this.node.dispatchEvent(SVG.events[event])
-
- // Remove detail
- delete SVG.events[event].detail
+ this.node.dispatchEvent(new CustomEvent(event, {detail:data}))
return this
}