mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-13 22:39:59 +08:00
fix($animate): use direct DOM comparison when checking for $rootElement
Closes #4679
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user