This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix(ngAnimate): ensure that only string-based addClass/removeClass values are applied #12459
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fe378ea
to
9783cee
Compare
matsko
added a commit
to matsko/angular.js
that referenced
this pull request
Jul 28, 2015
…lues are applied Related angular#11268 Closes angular#12458 Closes angular#12459
@matsko - looks good but I think the implementation could be DRYer with a helper: function addRemoveClassesPostDigest(element, add, remove) {
var data = postDigestQueue.get(element);
var updated = false;
var classVal;
var updateData = function(classes, value) {
var changed = false;
if (classes) {
classes = isString(classes) ? classes.split(' ') :
isArray(classes) ? classes : [];
forEach(classes, function(className) {
if (className) {
changed = true;
data[className] = value;
}
});
}
return changed;
};
if (!data) {
postDigestQueue.put(element, data = {});
postDigestElements.push(element);
}
updated = updateData(add, true);
updated = updated || updateData(remove, false);
if (!updated || postDigestElements.length > 1) return;
... |
@matsko, @petebacondarwin - Love the DRY refactor! Question: no support for |
…lues are applied Related angular#11268 Closes angular#12458 Closes angular#12459
9783cee
to
1003a88
Compare
@petebacondarwin the code has been updated. Please double check and merge in. |
LGTM |
Landed. Thanks @matsko. |
Doh! I only changes one of the test. Sorry. |
Thank you sir :) |
netman92
pushed a commit
to netman92/angular.js
that referenced
this pull request
Aug 8, 2015
…lues are applied Related angular#11268 Closes angular#12458 Closes angular#12459
ggershoni
pushed a commit
to ggershoni/angular.js
that referenced
this pull request
Sep 29, 2015
…lues are applied Related angular#11268 Closes angular#12458 Closes angular#12459
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #12458