Skip to content

Commit

Permalink
fix($animator): avoid completing the animation asynchronously unless …
Browse files Browse the repository at this point in the history
…CSS transtiions/animations are present

Closes angular#4023
Closes angular#3940
  • Loading branch information
matsko authored and jamesdaily committed Jan 27, 2014
1 parent 6690316 commit 590b943
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/ngAnimate/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 0 additions & 2 deletions test/ngAnimate/animateSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ describe("ngAnimate", function() {
element.addClass('ng-hide');
expect(element).toBeHidden();
$animate.removeClass(element, 'ng-hide');
$timeout.flush();
expect(element).toBeShown();
}));

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 590b943

Please sign in to comment.