diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-04-08 08:47:16 +1000 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-04-08 08:47:16 +1000 |
commit | a4a532d5b886d1e59a96cee7453f3b2ffb8f9285 (patch) | |
tree | aad52d48b9ff6872ed541d53049a75b4c528a74a /src | |
parent | d927f2d225d74fd3b3f41b298a19f6ba075702cf (diff) | |
download | svg.js-a4a532d5b886d1e59a96cee7453f3b2ffb8f9285.tar.gz svg.js-a4a532d5b886d1e59a96cee7453f3b2ffb8f9285.zip |
tests for EventTarget
Diffstat (limited to 'src')
-rw-r--r-- | src/elements/Dom.js | 2 | ||||
-rw-r--r-- | src/types/EventTarget.js | 13 |
2 files changed, 5 insertions, 10 deletions
diff --git a/src/elements/Dom.js b/src/elements/Dom.js index c9e6953..c67dd18 100644 --- a/src/elements/Dom.js +++ b/src/elements/Dom.js @@ -17,7 +17,7 @@ import attr from '../modules/core/attr.js' export default class Dom extends EventTarget { constructor (node, attrs) { - super(node) + super() this.node = node this.type = node.nodeName diff --git a/src/types/EventTarget.js b/src/types/EventTarget.js index b4a137a..6889605 100644 --- a/src/types/EventTarget.js +++ b/src/types/EventTarget.js @@ -3,15 +3,10 @@ import { register } from '../utils/adopter.js' import Base from './Base.js' export default class EventTarget extends Base { - constructor ({ events = {} } = {}) { - super() - this.events = events - } - addEventListener () {} - dispatch (event, data) { - return dispatch(this, event, data) + dispatch (event, data, options) { + return dispatch(this, event, data, options) } dispatchEvent (event) { @@ -30,8 +25,8 @@ export default class EventTarget extends Base { } // Fire given event - fire (event, data) { - this.dispatch(event, data) + fire (event, data, options) { + this.dispatch(event, data, options) return this } |