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

Function whenTransitionEnds

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

Source from the content-addressed store, hash-verified

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

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