diff options
| author | Matias Niemelä | 2013-10-28 21:44:06 -0700 |
|---|---|---|
| committer | Matias Niemelä | 2013-10-28 22:47:47 -0700 |
| commit | d434eabec3955f8d56c859c93befe711bfa1de27 (patch) | |
| tree | 576f2310f3fce0a1a5c99da8f757c883ec12000f | |
| parent | 7f0767acaba1ec3c8849244a604b0d1c8c376446 (diff) | |
| download | angular.js-d434eabec3955f8d56c859c93befe711bfa1de27.tar.bz2 | |
fix($animate): use direct DOM comparison when checking for $rootElement
Closes #4679
| -rw-r--r-- | src/ngAnimate/animate.js | 2 | ||||
| -rw-r--r-- | test/ngAnimate/animateSpec.js | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index 6b72f4a8..64be7ba7 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -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; } diff --git a/test/ngAnimate/animateSpec.js b/test/ngAnimate/animateSpec.js index bc0d3347..aba684b5 100644 --- a/test/ngAnimate/animateSpec.js +++ b/test/ngAnimate/animateSpec.js @@ -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); }); }); |
