Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2018-03-13 12:38:36 +0300
committerJohann-S <johann.servoire@gmail.com>2018-03-13 14:57:44 +0300
commit2c41b0aea6b2b1d1f1d812ab4455bea4a0759428 (patch)
tree69606a554481dae10238eb52e780f77a548e32a8 /js/src/util.js
parent1fadad1c33b99b94a4a821fe5c62c8064d129424 (diff)
fix get the transition duration parent
Diffstat (limited to 'js/src/util.js')
-rw-r--r--js/src/util.js9
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
},