MCPcopy Create free account
hub / github.com/angular-ui/ui-router / groupEventedAnimations

Function groupEventedAnimations

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

Source from the content-addressed store, hash-verified

1968 }
1969
1970 function groupEventedAnimations(element, event, options, animations, fnName) {
1971 var operations = [];
1972 forEach(animations, function(ani) {
1973 var animation = ani[fnName];
1974 if (!animation) return;
1975
1976 // note that all of these animations will run in parallel
1977 operations.push(function() {
1978 var runner;
1979 var endProgressCb;
1980
1981 var resolved = false;
1982 var onAnimationComplete = function(rejected) {
1983 if (!resolved) {
1984 resolved = true;
1985 (endProgressCb || noop)(rejected);
1986 runner.complete(!rejected);
1987 }
1988 };
1989
1990 runner = new $$AnimateRunner({
1991 end: function() {
1992 onAnimationComplete();
1993 },
1994 cancel: function() {
1995 onAnimationComplete(true);
1996 }
1997 });
1998
1999 endProgressCb = executeAnimationFn(animation, element, event, options, function(result) {
2000 var cancelled = result === false;
2001 onAnimationComplete(cancelled);
2002 });
2003
2004 return runner;
2005 });
2006 });
2007
2008 return operations;
2009 }
2010
2011 function packageAnimations(element, event, options, animations, fnName) {
2012 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