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

fix($animate): use direct DOM comparison when checking for $rootElement #4696

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ngAnimate/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ angular.module('ngAnimate', ['ng'])
}

function animationsDisabled(element, parent) {
if(element == $rootElement) {
if(element[0] == $rootElement[0]) {
return rootAnimateState.disabled || rootAnimateState.running;
}

Expand Down
5 changes: 5 additions & 0 deletions test/ngAnimate/animateSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ describe("ngAnimate", function() {

$animate.addClass(elm2, 'klass2');
expect(count).toBe(2);

var root = angular.element($rootElement[0]);
$rootElement.addClass('animated');
$animate.addClass(root, 'klass2');
expect(count).toBe(3);
});
});

Expand Down