From 35e79975595b4bdffa6a225653a05ea19ab58d3f Mon Sep 17 00:00:00 2001 From: Frank Date: Thu, 8 Oct 2015 20:32:34 -0600 Subject: [PATCH] Provide information about what class is being added for addClass and removeClass events --- src/ngAnimate/animateQueue.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ngAnimate/animateQueue.js b/src/ngAnimate/animateQueue.js index 3345dce7691d..5c7358056d28 100644 --- a/src/ngAnimate/animateQueue.js +++ b/src/ngAnimate/animateQueue.js @@ -401,6 +401,16 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) { markElementAnimationState(element, PRE_DIGEST_STATE, newAnimation); $rootScope.$$postDigest(function() { + //saves the addClass or removeClass before options manipulation + var classInfo = {}; + + if (options.addClass) { + classInfo.addClass = options.addClass; + } + if (options.removeClass) { + classInfo.removeClass = options.removeClass; + } + var animationDetails = activeAnimationsLookup.get(node); var animationCancelled = !animationDetails; animationDetails = animationDetails || {}; @@ -460,13 +470,13 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) { if (animationDetails && animationDetails.counter === counter) { clearElementAnimationState(getDomNode(element)); } - notifyProgress(runner, event, 'close', {}); + notifyProgress(runner, event, 'close', classInfo); }); // this will update the runner's flow-control events based on // the `realRunner` object. runner.setHost(realRunner); - notifyProgress(runner, event, 'start', {}); + notifyProgress(runner, event, 'start', classInfo); }); return runner;