(rejected)
| 1052 | } |
| 1053 | |
| 1054 | function close(rejected) { // jshint ignore:line |
| 1055 | // if the promise has been called already then we shouldn't close |
| 1056 | // the animation again |
| 1057 | if (animationClosed || (animationCompleted && animationPaused)) return; |
| 1058 | animationClosed = true; |
| 1059 | animationPaused = false; |
| 1060 | |
| 1061 | $$jqLite.removeClass(element, setupClasses); |
| 1062 | $$jqLite.removeClass(element, activeClasses); |
| 1063 | |
| 1064 | blockKeyframeAnimations(node, false); |
| 1065 | blockTransitions(node, false); |
| 1066 | |
| 1067 | forEach(temporaryStyles, function(entry) { |
| 1068 | // There is only one way to remove inline style properties entirely from elements. |
| 1069 | // By using `removeProperty` this works, but we need to convert camel-cased CSS |
| 1070 | // styles down to hyphenated values. |
| 1071 | node.style[entry[0]] = ''; |
| 1072 | }); |
| 1073 | |
| 1074 | applyAnimationClasses(element, options); |
| 1075 | applyAnimationStyles(element, options); |
| 1076 | |
| 1077 | // the reason why we have this option is to allow a synchronous closing callback |
| 1078 | // that is fired as SOON as the animation ends (when the CSS is removed) or if |
| 1079 | // the animation never takes off at all. A good example is a leave animation since |
| 1080 | // the element must be removed just after the animation is over or else the element |
| 1081 | // will appear on screen for one animation frame causing an overbearing flicker. |
| 1082 | if (options.onDone) { |
| 1083 | options.onDone(); |
| 1084 | } |
| 1085 | |
| 1086 | // if the preparation function fails then the promise is not setup |
| 1087 | if (runner) { |
| 1088 | runner.complete(!rejected); |
| 1089 | } |
| 1090 | } |
| 1091 | |
| 1092 | function applyBlocking(duration) { |
| 1093 | if (flags.blockTransition) { |
no test coverage detected