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

Function executeAnimationFn

test/angular/1.7/angular-animate.js:1911–1952  ·  view source on GitHub ↗
(fn, element, event, options, onDone)

Source from the content-addressed store, hash-verified

1909 };
1910
1911 function executeAnimationFn(fn, element, event, options, onDone) {
1912 var args;
1913 switch (event) {
1914 case 'animate':
1915 args = [element, options.from, options.to, onDone];
1916 break;
1917
1918 case 'setClass':
1919 args = [element, classesToAdd, classesToRemove, onDone];
1920 break;
1921
1922 case 'addClass':
1923 args = [element, classesToAdd, onDone];
1924 break;
1925
1926 case 'removeClass':
1927 args = [element, classesToRemove, onDone];
1928 break;
1929
1930 default:
1931 args = [element, onDone];
1932 break;
1933 }
1934
1935 args.push(options);
1936
1937 var value = fn.apply(fn, args);
1938 if (value) {
1939 if (isFunction(value.start)) {
1940 value = value.start();
1941 }
1942
1943 if (value instanceof $$AnimateRunner) {
1944 value.done(onDone);
1945 } else if (isFunction(value)) {
1946 // optional onEnd / onCancel callback
1947 return value;
1948 }
1949 }
1950
1951 return noop;
1952 }
1953
1954 function groupEventedAnimations(element, event, options, animations, fnName) {
1955 var operations = [];

Callers 1

groupEventedAnimationsFunction · 0.70

Calls 1

isFunctionFunction · 0.70

Tested by

no test coverage detected