diff options
Diffstat (limited to 'ext/mixed/js')
-rw-r--r-- | ext/mixed/js/core.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/mixed/js/core.js b/ext/mixed/js/core.js index c5c6fef2..8b044a67 100644 --- a/ext/mixed/js/core.js +++ b/ext/mixed/js/core.js @@ -341,6 +341,14 @@ class EventListenerCollection { return this._eventListeners.length; } + addGeneric(type, object, ...args) { + switch (type) { + case 'addEventListener': return this.addEventListener(object, ...args); + case 'addListener': return this.addListener(object, ...args); + case 'on': return this.on(object, ...args); + } + } + addEventListener(object, ...args) { object.addEventListener(...args); this._eventListeners.push(['removeEventListener', object, ...args]); |