Skip to content

Commit

Permalink
fix($animate): use direct DOM comparison when checking for $rootElement
Browse files Browse the repository at this point in the history
  • Loading branch information
matsko committed Oct 29, 2013
1 parent 7f0767a commit 77cbbc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit 77cbbc1

Please sign in to comment.