diff options
author | Johann-S <johann.servoire@gmail.com> | 2018-03-13 12:38:36 +0300 |
---|---|---|
committer | Johann-S <johann.servoire@gmail.com> | 2018-03-13 14:57:44 +0300 |
commit | 2c41b0aea6b2b1d1f1d812ab4455bea4a0759428 (patch) | |
tree | 69606a554481dae10238eb52e780f77a548e32a8 /js/src/util.js | |
parent | 1fadad1c33b99b94a4a821fe5c62c8064d129424 (diff) |
fix get the transition duration parent
Diffstat (limited to 'js/src/util.js')
-rw-r--r-- | js/src/util.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/js/src/util.js b/js/src/util.js index 05a69977c2..1b1f13beae 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -106,19 +106,22 @@ const Util = (($) => { }, getTransitionDurationFromElement(element) { + if (!element) { + return 0 + } + // Get transition-duration of the element let transitionDuration = $(element).css('transition-duration') + const floatTransitionDuration = parseFloat(transitionDuration) // Return 0 if element or transition duration is not found - if (!transitionDuration) { + if (!floatTransitionDuration) { return 0 } // If multiple durations are defined, take the first transitionDuration = transitionDuration.split(',')[0] - // jQuery always converts transition durations into seconds, - // so multiply by 1000 return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER }, |