Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 2a63dfa

Browse files
committed
fix($animator): avoid completing the animation asynchronously unless CSS transtiions/animations are present
Closes #4023 Closes #3940
1 parent 0d0330a commit 2a63dfa

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/ngAnimate/animate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ angular.module('ngAnimate', ['ng'])
481481
//avoid calling done() since there is no need to remove any
482482
//data or className values since this happens earlier than that
483483
//and also use a timeout so that it won't be asynchronous
484-
$timeout(onComplete || noop, 0, false);
484+
onComplete && onComplete();
485485
return;
486486
}
487487

test/ngAnimate/animateSpec.js

-2
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ describe("ngAnimate", function() {
503503
element.addClass('ng-hide');
504504
expect(element).toBeHidden();
505505
$animate.removeClass(element, 'ng-hide');
506-
$timeout.flush();
507506
expect(element).toBeShown();
508507
}));
509508

@@ -554,7 +553,6 @@ describe("ngAnimate", function() {
554553
element.addClass('ng-hide');
555554
expect(element).toBeHidden();
556555
$animate.removeClass(element, 'ng-hide');
557-
$timeout.flush();
558556
expect(element).toBeShown();
559557

560558
$animate.enabled(true);

0 commit comments

Comments
 (0)