diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-04-20 15:29:30 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-04-20 15:29:30 +0200 |
commit | 1a42cd3b054bdfdfd430738a63ef7c9cad6f982f (patch) | |
tree | 896feb638c43c18e161969fe28eeb9ff8f1093ad /src | |
parent | a34b465a301da6a54bbe47f2a1f68bb6c6762aba (diff) | |
download | svg.js-1a42cd3b054bdfdfd430738a63ef7c9cad6f982f.tar.gz svg.js-1a42cd3b054bdfdfd430738a63ef7c9cad6f982f.zip |
add options arguments to `on()`
Diffstat (limited to 'src')
-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 7d33efe..60f7a69 100644 --- a/src/event.js +++ b/src/event.js @@ -28,7 +28,7 @@ SVG.handlerMap = [] SVG.listenerId = 0 // Add event binder in the SVG namespace -SVG.on = function(node, event, listener, binding) { +SVG.on = function(node, event, listener, binding, options) { // create listener, get object-index var l = listener.bind(binding || node.instance || node) , index = (SVG.handlerMap.indexOf(node) + 1 || SVG.handlerMap.push(node)) - 1 @@ -48,7 +48,7 @@ SVG.on = function(node, event, listener, binding) { SVG.listeners[index][ev][ns][listener._svgjsListenerId] = l // add listener - node.addEventListener(ev, l, false) + node.addEventListener(ev, l, options || false) } // Add event unbinder in the SVG namespace @@ -114,8 +114,8 @@ SVG.off = function(node, event, listener) { // SVG.extend(SVG.Element, { // Bind given event to listener - on: function(event, listener, binding) { - SVG.on(this.node, event, listener, binding) + on: function(event, listener, binding, options) { + SVG.on(this.node, event, listener, binding, options) return this } |