diff options
author | Sam Potts <sam@potts.es> | 2019-01-26 22:45:47 +1100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2019-01-26 22:45:47 +1100 |
commit | 1d51b287014697701b78c883f70c9963f4253d3c (patch) | |
tree | 1a24fa6e2095be4dfdf223fbb0da5549b34c46b3 /src/js/utils | |
parent | dc54eba8f8dfc79ce51fe8ca47bb0e252fccf1b4 (diff) | |
download | plyr-1d51b287014697701b78c883f70c9963f4253d3c.tar.lz plyr-1d51b287014697701b78c883f70c9963f4253d3c.tar.xz plyr-1d51b287014697701b78c883f70c9963f4253d3c.zip |
Tweaks
Diffstat (limited to 'src/js/utils')
-rw-r--r-- | src/js/utils/events.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/js/utils/events.js b/src/js/utils/events.js index 9f734f04..d304c312 100644 --- a/src/js/utils/events.js +++ b/src/js/utils/events.js @@ -73,10 +73,10 @@ export function off(element, events = '', callback, passive = true, capture = fa // Bind once-only event handler export function once(element, events = '', callback, passive = true, capture = false) { - function onceCallback(...args) { + const onceCallback = (...args) => { off(element, events, onceCallback, passive, capture); callback.apply(this, args); - } + }; toggleListener.call(this, element, events, onceCallback, true, passive, capture); } @@ -114,7 +114,7 @@ export function unbindListeners() { // Run method when / if player is ready export function ready() { - return new Promise( - resolve => (this.ready ? setTimeout(resolve, 0) : on.call(this, this.elements.container, 'ready', resolve)), + return new Promise(resolve => + this.ready ? setTimeout(resolve, 0) : on.call(this, this.elements.container, 'ready', resolve), ).then(() => {}); } |