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

Function groupEventedAnimations

test/angular/1.7/angular-animate.js:1954–1993  ·  view source on GitHub ↗
(element, event, options, animations, fnName)

Source from the content-addressed store, hash-verified

1952 }
1953
1954 function groupEventedAnimations(element, event, options, animations, fnName) {
1955 var operations = [];
1956 forEach(animations, function(ani) {
1957 var animation = ani[fnName];
1958 if (!animation) return;
1959
1960 // note that all of these animations will run in parallel
1961 operations.push(function() {
1962 var runner;
1963 var endProgressCb;
1964
1965 var resolved = false;
1966 var onAnimationComplete = function(rejected) {
1967 if (!resolved) {
1968 resolved = true;
1969 (endProgressCb || noop)(rejected);
1970 runner.complete(!rejected);
1971 }
1972 };
1973
1974 runner = new $$AnimateRunner({
1975 end: function() {
1976 onAnimationComplete();
1977 },
1978 cancel: function() {
1979 onAnimationComplete(true);
1980 }
1981 });
1982
1983 endProgressCb = executeAnimationFn(animation, element, event, options, function(result) {
1984 var cancelled = result === false;
1985 onAnimationComplete(cancelled);
1986 });
1987
1988 return runner;
1989 });
1990 });
1991
1992 return operations;
1993 }
1994
1995 function packageAnimations(element, event, options, animations, fnName) {
1996 var operations = groupEventedAnimations(element, event, options, animations, fnName);

Callers 1

packageAnimationsFunction · 0.70

Calls 3

forEachFunction · 0.70
onAnimationCompleteFunction · 0.70
executeAnimationFnFunction · 0.70

Tested by

no test coverage detected