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

Function queueAnimation

test/angular/1.4/angular-animate.js:2418–2693  ·  view source on GitHub ↗
(element, event, initialOptions)

Source from the content-addressed store, hash-verified

2416 };
2417
2418 function queueAnimation(element, event, initialOptions) {
2419 // we always make a copy of the options since
2420 // there should never be any side effects on
2421 // the input data when running `$animateCss`.
2422 var options = copy(initialOptions);
2423
2424 var node, parent;
2425 element = stripCommentsFromElement(element);
2426 if (element) {
2427 node = getDomNode(element);
2428 parent = element.parent();
2429 }
2430
2431 options = prepareAnimationOptions(options);
2432
2433 // we create a fake runner with a working promise.
2434 // These methods will become available after the digest has passed
2435 var runner = new $$AnimateRunner();
2436
2437 // this is used to trigger callbacks in postDigest mode
2438 var runInNextPostDigestOrNow = postDigestTaskFactory();
2439
2440 if (isArray(options.addClass)) {
2441 options.addClass = options.addClass.join(' ');
2442 }
2443
2444 if (options.addClass && !isString(options.addClass)) {
2445 options.addClass = null;
2446 }
2447
2448 if (isArray(options.removeClass)) {
2449 options.removeClass = options.removeClass.join(' ');
2450 }
2451
2452 if (options.removeClass && !isString(options.removeClass)) {
2453 options.removeClass = null;
2454 }
2455
2456 if (options.from && !isObject(options.from)) {
2457 options.from = null;
2458 }
2459
2460 if (options.to && !isObject(options.to)) {
2461 options.to = null;
2462 }
2463
2464 // there are situations where a directive issues an animation for
2465 // a jqLite wrapper that contains only comment nodes... If this
2466 // happens then there is no way we can perform an animation
2467 if (!node) {
2468 close();
2469 return runner;
2470 }
2471
2472 var className = [node.className, options.addClass, options.removeClass].join(' ');
2473 if (!isAnimatableClassName(className)) {
2474 close();
2475 return runner;

Callers 1

angular-animate.jsFile · 0.70

Calls 15

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

Tested by

no test coverage detected