From 913cf794c974dd8953acd18eee48ad5947486c81 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Thu, 5 Jan 2017 13:59:07 +0200 Subject: [PATCH] perf($animate): do not retrieve `className` unless `classNameFilter` is used --- src/ngAnimate/animateQueue.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ngAnimate/animateQueue.js b/src/ngAnimate/animateQueue.js index 3dd080325a28..92408ffffce5 100644 --- a/src/ngAnimate/animateQueue.js +++ b/src/ngAnimate/animateQueue.js @@ -165,7 +165,8 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate var classNameFilter = $animateProvider.classNameFilter(); var isAnimatableClassName = !classNameFilter ? function() { return true; } - : function(className) { + : function(node, options) { + var className = [node.getAttribute('class'), options.addClass, options.removeClass].join(' '); return classNameFilter.test(className); }; @@ -353,8 +354,7 @@ var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animate return runner; } - var className = [node.getAttribute('class'), options.addClass, options.removeClass].join(' '); - if (!isAnimatableClassName(className)) { + if (!isAnimatableClassName(node, options)) { close(); return runner; }