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

Function whenTransitionEnds

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

Source from the content-addressed store, hash-verified

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

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