diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-18 12:37:55 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-10-18 12:37:55 +0200 |
commit | f46aedf58fbc93483cb21017ffed10e439830108 (patch) | |
tree | 2633bc1034a4fceaca977f45ef386ecc07abe519 /src/event.js | |
parent | e9ec77f512b01f067b20e037385f4e8074cb4bdb (diff) | |
download | svg.js-f46aedf58fbc93483cb21017ffed10e439830108.tar.gz svg.js-f46aedf58fbc93483cb21017ffed10e439830108.zip |
fix tests
Diffstat (limited to 'src/event.js')
-rw-r--r-- | src/event.js | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/src/event.js b/src/event.js index 64a791c..4f16609 100644 --- a/src/event.js +++ b/src/event.js @@ -1,5 +1,4 @@ // Add events to elements -/* ;[ 'click', 'dblclick', 'mousedown', @@ -16,12 +15,14 @@ 'touchcancel' ].forEach(function (event) { // add event to SVG.Element SVG.Element.prototype[event] = function (f) { - // bind event to element rather than element node - SVG.on(this, event, f) + if (f === null) { + SVG.off(this, event) + } else { + SVG.on(this, event, f) + } return this } }) -*/ SVG.listenerId = 0 @@ -132,27 +133,3 @@ SVG.dispatch = function (node, event, data) { } return event } - -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 - } - } -}) |