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

Function whenTransitionEnds

static/vuejs/vue.runtime.common.js:5820–5849  ·  view source on GitHub ↗
(
  el,
  expectedType,
  cb
)

Source from the content-addressed store, hash-verified

5818}
5819
5820function whenTransitionEnds (
5821 el,
5822 expectedType,
5823 cb
5824) {
5825 var ref = getTransitionInfo(el, expectedType);
5826 var type = ref.type;
5827 var timeout = ref.timeout;
5828 var propCount = ref.propCount;
5829 if (!type) { return cb() }
5830 var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
5831 var ended = 0;
5832 var end = function () {
5833 el.removeEventListener(event, onEnd);
5834 cb();
5835 };
5836 var onEnd = function (e) {
5837 if (e.target === el) {
5838 if (++ended >= propCount) {
5839 end();
5840 }
5841 }
5842 };
5843 setTimeout(function () {
5844 if (ended < propCount) {
5845 end();
5846 }
5847 }, timeout + 1);
5848 el.addEventListener(event, onEnd);
5849}
5850
5851var transformRE = /\b(transform|all)(,|$)/;
5852

Callers 2

enterFunction · 0.70
performLeaveFunction · 0.70

Calls 3

getTransitionInfoFunction · 0.70
cbFunction · 0.70
endFunction · 0.70

Tested by

no test coverage detected