MCPcopy Index your code
hub / github.com/angular-ui/ui-router / packageAnimations

Function packageAnimations

test/angular/1.5/angular-animate.js:2011–2058  ·  view source on GitHub ↗
(element, event, options, animations, fnName)

Source from the content-addressed store, hash-verified

2009 }
2010
2011 function packageAnimations(element, event, options, animations, fnName) {
2012 var operations = groupEventedAnimations(element, event, options, animations, fnName);
2013 if (operations.length === 0) {
2014 var a, b;
2015 if (fnName === 'beforeSetClass') {
2016 a = groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass');
2017 b = groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass');
2018 } else if (fnName === 'setClass') {
2019 a = groupEventedAnimations(element, 'removeClass', options, animations, 'removeClass');
2020 b = groupEventedAnimations(element, 'addClass', options, animations, 'addClass');
2021 }
2022
2023 if (a) {
2024 operations = operations.concat(a);
2025 }
2026 if (b) {
2027 operations = operations.concat(b);
2028 }
2029 }
2030
2031 if (operations.length === 0) return;
2032
2033 // TODO(matsko): add documentation
2034 return function startAnimation(callback) {
2035 var runners = [];
2036 if (operations.length) {
2037 forEach(operations, function(animateFn) {
2038 runners.push(animateFn());
2039 });
2040 }
2041
2042 if (runners.length) {
2043 $$AnimateRunner.all(runners, callback);
2044 } else {
2045 callback();
2046 }
2047
2048 return function endFn(reject) {
2049 forEach(runners, function(runner) {
2050 if (reject) {
2051 runner.cancel();
2052 } else {
2053 runner.end();
2054 }
2055 });
2056 };
2057 };
2058 }
2059 };
2060
2061 function lookupAnimations(classes) {

Callers 1

angular-animate.jsFile · 0.70

Calls 3

groupEventedAnimationsFunction · 0.70
forEachFunction · 0.70
callbackFunction · 0.70

Tested by

no test coverage detected