diff options
author | Sam Potts <sam@potts.es> | 2020-04-24 00:22:39 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-24 00:22:39 +1000 |
commit | 68137aa789b195b26d4306eaebc7fee2f8eb3374 (patch) | |
tree | 8c38683d043fdfbe8b1dcb385a446de4df7396a1 /src/js/utils/animation.js | |
parent | dbe618c644a525b196466b7254274cc9bde76275 (diff) | |
parent | 2458eaa11b5c2805bcf1e5349ab900485bac325f (diff) | |
download | plyr-68137aa789b195b26d4306eaebc7fee2f8eb3374.tar.lz plyr-68137aa789b195b26d4306eaebc7fee2f8eb3374.tar.xz plyr-68137aa789b195b26d4306eaebc7fee2f8eb3374.zip |
Merge pull request #1770 from sampotts/css-variables
Allow customization via CSS Custom Properties
Diffstat (limited to 'src/js/utils/animation.js')
-rw-r--r-- | src/js/utils/animation.js | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/js/utils/animation.js b/src/js/utils/animation.js index 3f721b5a..d9e7615e 100644 --- a/src/js/utils/animation.js +++ b/src/js/utils/animation.js @@ -5,34 +5,34 @@ import is from './is'; export const transitionEndEvent = (() => { - const element = document.createElement('span'); + const element = document.createElement('span'); - const events = { - WebkitTransition: 'webkitTransitionEnd', - MozTransition: 'transitionend', - OTransition: 'oTransitionEnd otransitionend', - transition: 'transitionend', - }; + const events = { + WebkitTransition: 'webkitTransitionEnd', + MozTransition: 'transitionend', + OTransition: 'oTransitionEnd otransitionend', + transition: 'transitionend', + }; - const type = Object.keys(events).find(event => element.style[event] !== undefined); + const type = Object.keys(events).find(event => element.style[event] !== undefined); - return is.string(type) ? events[type] : false; + return is.string(type) ? events[type] : false; })(); // Force repaint of element export function repaint(element, delay) { - setTimeout(() => { - try { - // eslint-disable-next-line no-param-reassign - element.hidden = true; - - // eslint-disable-next-line no-unused-expressions - element.offsetHeight; - - // eslint-disable-next-line no-param-reassign - element.hidden = false; - } catch (e) { - // Do nothing - } - }, delay); + setTimeout(() => { + try { + // eslint-disable-next-line no-param-reassign + element.hidden = true; + + // eslint-disable-next-line no-unused-expressions + element.offsetHeight; + + // eslint-disable-next-line no-param-reassign + element.hidden = false; + } catch (e) { + // Do nothing + } + }, delay); } |