diff options
author | Sam Potts <sam@potts.es> | 2020-01-30 14:23:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-30 14:23:10 +0000 |
commit | 9d512911252cf4835c2b7364cb4ae392cb277a1d (patch) | |
tree | 5e6dcc7647285e49683f05d8a49187e8078d0d2b /src/js/utils/animation.js | |
parent | 44d3a17870949e828e5b1a4619a30dfcb626a174 (diff) | |
parent | b2ac730572ad81aa9755e8b7852c53ceba0e8e9f (diff) | |
download | plyr-9d512911252cf4835c2b7364cb4ae392cb277a1d.tar.lz plyr-9d512911252cf4835c2b7364cb4ae392cb277a1d.tar.xz plyr-9d512911252cf4835c2b7364cb4ae392cb277a1d.zip |
Merge pull request #1663 from sampotts/master
Merge back to beta
Diffstat (limited to 'src/js/utils/animation.js')
-rw-r--r-- | src/js/utils/animation.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/js/utils/animation.js b/src/js/utils/animation.js index 6b950b61..3f721b5a 100644 --- a/src/js/utils/animation.js +++ b/src/js/utils/animation.js @@ -2,7 +2,6 @@ // Animation utils // ========================================================================== -import { toggleHidden } from './elements'; import is from './is'; export const transitionEndEvent = (() => { @@ -21,14 +20,19 @@ export const transitionEndEvent = (() => { })(); // Force repaint of element -export function repaint(element) { +export function repaint(element, delay) { setTimeout(() => { try { - toggleHidden(element, true); - element.offsetHeight; // eslint-disable-line - toggleHidden(element, false); + // 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 } - }, 0); + }, delay); } |