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

Function getTransitionInfo

static/vuejs/vue.runtime.js:5847–5894  ·  view source on GitHub ↗
(el, expectedType)

Source from the content-addressed store, hash-verified

5845var transformRE = /\b(transform|all)(,|$)/;
5846
5847function getTransitionInfo (el, expectedType) {
5848 var styles = window.getComputedStyle(el);
5849 var transitionDelays = styles[transitionProp + 'Delay'].split(', ');
5850 var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
5851 var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
5852 var animationDelays = styles[animationProp + 'Delay'].split(', ');
5853 var animationDurations = styles[animationProp + 'Duration'].split(', ');
5854 var animationTimeout = getTimeout(animationDelays, animationDurations);
5855
5856 var type;
5857 var timeout = 0;
5858 var propCount = 0;
5859 /* istanbul ignore if */
5860 if (expectedType === TRANSITION) {
5861 if (transitionTimeout > 0) {
5862 type = TRANSITION;
5863 timeout = transitionTimeout;
5864 propCount = transitionDurations.length;
5865 }
5866 } else if (expectedType === ANIMATION) {
5867 if (animationTimeout > 0) {
5868 type = ANIMATION;
5869 timeout = animationTimeout;
5870 propCount = animationDurations.length;
5871 }
5872 } else {
5873 timeout = Math.max(transitionTimeout, animationTimeout);
5874 type = timeout > 0
5875 ? transitionTimeout > animationTimeout
5876 ? TRANSITION
5877 : ANIMATION
5878 : null;
5879 propCount = type
5880 ? type === TRANSITION
5881 ? transitionDurations.length
5882 : animationDurations.length
5883 : 0;
5884 }
5885 var hasTransform =
5886 type === TRANSITION &&
5887 transformRE.test(styles[transitionProp + 'Property']);
5888 return {
5889 type: type,
5890 timeout: timeout,
5891 propCount: propCount,
5892 hasTransform: hasTransform
5893 }
5894}
5895
5896function getTimeout (delays, durations) {
5897 /* istanbul ignore next */

Callers 2

whenTransitionEndsFunction · 0.70
vue.runtime.jsFile · 0.70

Calls 1

getTimeoutFunction · 0.70

Tested by

no test coverage detected