MCPcopy Create free account
hub / github.com/TruthHun/BookStack / getTransitionInfo

Function getTransitionInfo

static/vuejs/vue.common.js:6301–6348  ·  view source on GitHub ↗
(el, expectedType)

Source from the content-addressed store, hash-verified

6299var transformRE = /\b(transform|all)(,|$)/;
6300
6301function getTransitionInfo (el, expectedType) {
6302 var styles = window.getComputedStyle(el);
6303 var transitionDelays = styles[transitionProp + 'Delay'].split(', ');
6304 var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
6305 var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
6306 var animationDelays = styles[animationProp + 'Delay'].split(', ');
6307 var animationDurations = styles[animationProp + 'Duration'].split(', ');
6308 var animationTimeout = getTimeout(animationDelays, animationDurations);
6309
6310 var type;
6311 var timeout = 0;
6312 var propCount = 0;
6313 /* istanbul ignore if */
6314 if (expectedType === TRANSITION) {
6315 if (transitionTimeout > 0) {
6316 type = TRANSITION;
6317 timeout = transitionTimeout;
6318 propCount = transitionDurations.length;
6319 }
6320 } else if (expectedType === ANIMATION) {
6321 if (animationTimeout > 0) {
6322 type = ANIMATION;
6323 timeout = animationTimeout;
6324 propCount = animationDurations.length;
6325 }
6326 } else {
6327 timeout = Math.max(transitionTimeout, animationTimeout);
6328 type = timeout > 0
6329 ? transitionTimeout > animationTimeout
6330 ? TRANSITION
6331 : ANIMATION
6332 : null;
6333 propCount = type
6334 ? type === TRANSITION
6335 ? transitionDurations.length
6336 : animationDurations.length
6337 : 0;
6338 }
6339 var hasTransform =
6340 type === TRANSITION &&
6341 transformRE.test(styles[transitionProp + 'Property']);
6342 return {
6343 type: type,
6344 timeout: timeout,
6345 propCount: propCount,
6346 hasTransform: hasTransform
6347 }
6348}
6349
6350function getTimeout (delays, durations) {
6351 /* istanbul ignore next */

Callers 2

whenTransitionEndsFunction · 0.70
vue.common.jsFile · 0.70

Calls 1

getTimeoutFunction · 0.70

Tested by

no test coverage detected