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

Function executeAnimationFn

test/angular/1.5/angular-animate.js:1927–1968  ·  view source on GitHub ↗
(fn, element, event, options, onDone)

Source from the content-addressed store, hash-verified

1925 };
1926
1927 function executeAnimationFn(fn, element, event, options, onDone) {
1928 var args;
1929 switch (event) {
1930 case 'animate':
1931 args = [element, options.from, options.to, onDone];
1932 break;
1933
1934 case 'setClass':
1935 args = [element, classesToAdd, classesToRemove, onDone];
1936 break;
1937
1938 case 'addClass':
1939 args = [element, classesToAdd, onDone];
1940 break;
1941
1942 case 'removeClass':
1943 args = [element, classesToRemove, onDone];
1944 break;
1945
1946 default:
1947 args = [element, onDone];
1948 break;
1949 }
1950
1951 args.push(options);
1952
1953 var value = fn.apply(fn, args);
1954 if (value) {
1955 if (isFunction(value.start)) {
1956 value = value.start();
1957 }
1958
1959 if (value instanceof $$AnimateRunner) {
1960 value.done(onDone);
1961 } else if (isFunction(value)) {
1962 // optional onEnd / onCancel callback
1963 return value;
1964 }
1965 }
1966
1967 return noop;
1968 }
1969
1970 function groupEventedAnimations(element, event, options, animations, fnName) {
1971 var operations = [];

Callers 1

groupEventedAnimationsFunction · 0.70

Calls 1

isFunctionFunction · 0.70

Tested by

no test coverage detected