aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatias Niemelä2013-10-01 14:12:19 -0400
committerMatias Niemelä2013-10-01 15:00:16 -0400
commit2a63dfa6cc7889888f4296fff2944e74ff30b3af (patch)
treed73e280aadccfa2067479d9ce878bd625092bb3f
parent0d0330adc24a68cd6891a030a56d3ce3bbced03c (diff)
downloadangular.js-2a63dfa6cc7889888f4296fff2944e74ff30b3af.tar.bz2
fix($animator): avoid completing the animation asynchronously unless CSS transtiions/animations are present
Closes #4023 Closes #3940
-rw-r--r--src/ngAnimate/animate.js2
-rw-r--r--test/ngAnimate/animateSpec.js2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js
index 44b94563..7fcdef73 100644
--- a/src/ngAnimate/animate.js
+++ b/src/ngAnimate/animate.js
@@ -481,7 +481,7 @@ angular.module('ngAnimate', ['ng'])
//avoid calling done() since there is no need to remove any
//data or className values since this happens earlier than that
//and also use a timeout so that it won't be asynchronous
- $timeout(onComplete || noop, 0, false);
+ onComplete && onComplete();
return;
}
diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js
index 81d84f96..f5faa024 100644
--- a/test/ngAnimate/animateSpec.js
+++ b/test/ngAnimate/animateSpec.js
@@ -503,7 +503,6 @@ describe("ngAnimate", function() {
element.addClass('ng-hide');
expect(element).toBeHidden();
$animate.removeClass(element, 'ng-hide');
- $timeout.flush();
expect(element).toBeShown();
}));
@@ -554,7 +553,6 @@ describe("ngAnimate", function() {
element.addClass('ng-hide');
expect(element).toBeHidden();
$animate.removeClass(element, 'ng-hide');
- $timeout.flush();
expect(element).toBeShown();
$animate.enabled(true);