diff options
author | Martijn Cuppens <martijn.cuppens@gmail.com> | 2018-10-29 23:11:50 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2018-10-30 09:57:02 +0300 |
commit | 5aed968750177ec35f99dc03e71eec3632beb844 (patch) | |
tree | e4a3c6c0dab1dfe588b7ed6e779d4b9754ed804e /js/src/util.js | |
parent | 5e6b53a7c012be9bcef5b2c5edc7b3cdafc102a7 (diff) |
Prevent the background to be shown when transitioning
Diffstat (limited to 'js/src/util.js')
-rw-r--r-- | js/src/util.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/js/src/util.js b/js/src/util.js index 622b468371..92ad2a7220 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -93,17 +93,21 @@ const Util = { // Get transition-duration of the element let transitionDuration = $(element).css('transition-duration') + let transitionDelay = $(element).css('transition-delay') + const floatTransitionDuration = parseFloat(transitionDuration) + const floatTransitionDelay = parseFloat(transitionDelay) // Return 0 if element or transition duration is not found - if (!floatTransitionDuration) { + if (!floatTransitionDuration && !floatTransitionDelay) { return 0 } // If multiple durations are defined, take the first transitionDuration = transitionDuration.split(',')[0] + transitionDelay = transitionDelay.split(',')[0] - return parseFloat(transitionDuration) * MILLISECONDS_MULTIPLIER + return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER }, reflow(element) { |