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

Function whenTransitionEnds

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

Source from the content-addressed store, hash-verified

6260}
6261
6262function whenTransitionEnds (
6263 el,
6264 expectedType,
6265 cb
6266) {
6267 var ref = getTransitionInfo(el, expectedType);
6268 var type = ref.type;
6269 var timeout = ref.timeout;
6270 var propCount = ref.propCount;
6271 if (!type) { return cb() }
6272 var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
6273 var ended = 0;
6274 var end = function () {
6275 el.removeEventListener(event, onEnd);
6276 cb();
6277 };
6278 var onEnd = function (e) {
6279 if (e.target === el) {
6280 if (++ended >= propCount) {
6281 end();
6282 }
6283 }
6284 };
6285 setTimeout(function () {
6286 if (ended < propCount) {
6287 end();
6288 }
6289 }, timeout + 1);
6290 el.addEventListener(event, onEnd);
6291}
6292
6293var transformRE = /\b(transform|all)(,|$)/;
6294

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