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

Function whenTransitionEnds

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

Source from the content-addressed store, hash-verified

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

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