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

Function whenTransitionEnds

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

Source from the content-addressed store, hash-verified

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

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