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

Commit 6eae31c

Browse files
committed
(Fixup) Revert "fix(ng.$animate): forward cancel to animation runner"
This reverts commit 181efa9, because it's incorrect
1 parent a78f687 commit 6eae31c

File tree

2 files changed

+2
-29
lines changed

2 files changed

+2
-29
lines changed

src/ng/animate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) {
416416
* @param {Promise} animationPromise The animation promise that is returned when an animation is started.
417417
*/
418418
cancel: function(runner) {
419-
if (runner.cancel) {
420-
runner.cancel();
419+
if (runner.end) {
420+
runner.end();
421421
}
422422
},
423423

test/ng/animateSpec.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -530,33 +530,6 @@ describe('$animate', function() {
530530
}));
531531

532532

533-
it('should reject the promise when the animation is cancelled', inject(function(log, $animate, $$rAF, $rootScope) {
534-
element = jqLite('<p class="test2">test</p>');
535-
536-
var addRunner = $animate.addClass(element, 'test1');
537-
addRunner.then(function() {
538-
log('addClass(test1)success');
539-
}).catch(function() {
540-
log('addClass(test1)error');
541-
});
542-
543-
544-
var removeRunner = $animate.removeClass(element, 'test2');
545-
removeRunner.then(function() {
546-
log('removeClass(test2)success');
547-
}).catch(function() {
548-
log('removeClass(test2)error');
549-
});
550-
551-
$rootScope.$digest();
552-
expect(log).toEqual([]);
553-
$animate.cancel(addRunner);
554-
$animate.cancel(removeRunner);
555-
$rootScope.$digest();
556-
expect(log.toArray()).toEqual(['addClass(test1)error', 'removeClass(test2)error']);
557-
}));
558-
559-
560533
it('should defer class manipulation until end of digest for SVG', inject(function($rootScope, $animate) {
561534
if (!window.SVGElement) return;
562535
setupClassManipulationSpies();

0 commit comments

Comments
 (0)