fix($animator): avoid completing the animation asynchronously unless CSS transtiions/animations are present

Closes #4023
Closes #3940
This commit is contained in:
Matias Niemelä 2013-10-01 14:12:19 -04:00
parent 0d0330adc2
commit 2a63dfa6cc
2 changed files with 1 additions and 3 deletions

View file

@ -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;
}

View file

@ -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);