From da61aed18bb0bf4dd0e3e3a4ddfd3c736cf3930b Mon Sep 17 00:00:00 2001 From: Antonio Laguna Date: Sat, 17 Jun 2017 16:23:37 +0200 Subject: [PATCH] Adding default animationEnd to play nice with JSDom --- src/js/utils/dom.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/js/utils/dom.js b/src/js/utils/dom.js index 27d775c..cd900da 100644 --- a/src/js/utils/dom.js +++ b/src/js/utils/dom.js @@ -89,7 +89,7 @@ export default class DOM { return animationEvent; } - animationEvent = ''; + animationEvent = 'animationend'; const el = optEl || document.createElement('ws'); const animations = { @@ -101,11 +101,12 @@ export default class DOM { const animationNames = Object.keys(animations); for (let i = 0, length = animationNames.length; - i < length && !animationEvent; i++) { + i < length; i++) { const animationName = animationNames[i]; if (typeof el.style[animationName] !== 'undefined') { animationEvent = animations[animationName]; + break; } }