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

Commit d434eab

Browse files
committed
fix($animate): use direct DOM comparison when checking for $rootElement
Closes #4679
1 parent 7f0767a commit d434eab

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/ngAnimate/animate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ angular.module('ngAnimate', ['ng'])
697697
}
698698

699699
function animationsDisabled(element, parent) {
700-
if(element == $rootElement) {
700+
if(element[0] == $rootElement[0]) {
701701
return rootAnimateState.disabled || rootAnimateState.running;
702702
}
703703

test/ngAnimate/animateSpec.js

+5
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ describe("ngAnimate", function() {
9696

9797
$animate.addClass(elm2, 'klass2');
9898
expect(count).toBe(2);
99+
100+
var root = angular.element($rootElement[0]);
101+
$rootElement.addClass('animated');
102+
$animate.addClass(root, 'klass2');
103+
expect(count).toBe(3);
99104
});
100105
});
101106

0 commit comments

Comments
 (0)