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

fix(ngAnimate): Provide information about what class is being added for addClass and removeClass events #13059

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/ngAnimate/animateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {};
Expand Down Expand Up @@ -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;
Expand Down