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

Commit 8c71c02

Browse files
committed
refactor(ngAnimate): simplify cleanupEventListeners() and remove redundant calls
1 parent d5ea497 commit 8c71c02

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ngAnimate/animateQueue.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
209209
});
210210
}
211211

212-
function cleanupEventListeners(phase, element) {
213-
if (phase === 'close' && !element[0].parentNode) {
212+
function cleanupEventListeners(phase, node) {
213+
if (phase === 'close' && !node.parentNode) {
214214
// If the element is not attached to a parentNode, it has been removed by
215215
// the domOperation, and we can safely remove the event callbacks
216-
$animate.off(element);
216+
$animate.off(node);
217217
}
218218
}
219219

@@ -567,10 +567,10 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate
567567
forEach(callbacks, function(callback) {
568568
callback(element, phase, data);
569569
});
570-
cleanupEventListeners(phase, element);
570+
cleanupEventListeners(phase, node);
571571
});
572572
} else {
573-
cleanupEventListeners(phase, element);
573+
cleanupEventListeners(phase, node);
574574
}
575575
});
576576
runner.progress(event, phase, data);

0 commit comments

Comments
 (0)