MCPcopy
hub / github.com/angular-ui/ui-grid / queueAnimation

Function queueAnimation

lib/test/angular/1.8.0/angular-animate.js:2444–2724  ·  view source on GitHub ↗
(originalElement, event, initialOptions)

Source from the content-addressed store, hash-verified

2442 return $animate;
2443
2444 function queueAnimation(originalElement, event, initialOptions) {
2445 // we always make a copy of the options since
2446 // there should never be any side effects on
2447 // the input data when running `$animateCss`.
2448 var options = copy(initialOptions);
2449
2450 var element = stripCommentsFromElement(originalElement);
2451 var node = getDomNode(element);
2452 var parentNode = node && node.parentNode;
2453
2454 options = prepareAnimationOptions(options);
2455
2456 // we create a fake runner with a working promise.
2457 // These methods will become available after the digest has passed
2458 var runner = new $$AnimateRunner();
2459
2460 // this is used to trigger callbacks in postDigest mode
2461 var runInNextPostDigestOrNow = postDigestTaskFactory();
2462
2463 if (isArray(options.addClass)) {
2464 options.addClass = options.addClass.join(' ');
2465 }
2466
2467 if (options.addClass && !isString(options.addClass)) {
2468 options.addClass = null;
2469 }
2470
2471 if (isArray(options.removeClass)) {
2472 options.removeClass = options.removeClass.join(' ');
2473 }
2474
2475 if (options.removeClass && !isString(options.removeClass)) {
2476 options.removeClass = null;
2477 }
2478
2479 if (options.from && !isObject(options.from)) {
2480 options.from = null;
2481 }
2482
2483 if (options.to && !isObject(options.to)) {
2484 options.to = null;
2485 }
2486
2487 // If animations are hard-disabled for the whole application there is no need to continue.
2488 // There are also situations where a directive issues an animation for a jqLite wrapper that
2489 // contains only comment nodes. In this case, there is no way we can perform an animation.
2490 if (!animationsEnabled ||
2491 !node ||
2492 !isAnimatableByFilter(node, event, initialOptions) ||
2493 !isAnimatableClassName(node, options)) {
2494 close();
2495 return runner;
2496 }
2497
2498 var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;
2499
2500 var documentHidden = $$isDocumentHidden();
2501

Callers 1

angular-animate.jsFile · 0.70

Calls 15

getEventDataFunction · 0.85
copyFunction · 0.70
stripCommentsFromElementFunction · 0.70
getDomNodeFunction · 0.70
prepareAnimationOptionsFunction · 0.70
postDigestTaskFactoryFunction · 0.70
isArrayFunction · 0.70
isStringFunction · 0.70
isObjectFunction · 0.70
closeFunction · 0.70
areAnimationsAllowedFunction · 0.70
notifyProgressFunction · 0.70

Tested by

no test coverage detected