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
feat($animateCss): add support for temporary styles via cleanupStyles
#12930
Closed
Conversation
This file contains hidden or 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
Some animations make use of the `from` and `to` styling only for the lifetime of the animation. This patch allows for those styles to be removed once the animation is closed automatically within `$animateCss`.
310bff5
to
c2ceb89
Compare
@@ -204,6 +204,7 @@ var ANIMATE_TIMER_KEY = '$$animateCss'; | |||
* * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a | |||
* * `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`) | |||
* * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occuring on the classes being added and removed.) | |||
* * `cleanupStyles` - Whether or not the provided `from` and `to` styles will be removed once the animation is closed. This is useful for when the styles are used purely for the sake of the animation and do not have a lasting visual effect on the element (e.g. a colapse and open animation). By default this value is set to `false`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too long lines :(
This LGTM in general. I wonder if a next step could be to refine the |
@petebacondarwin I can see a use for that, but I don't want to bloat the API too much. Is there an animation that you can think of where this would be useful? |
let's keep the api simple for now. we can always expand it later via optional hashValue. assuming all the other comments are resolved, this looks good to me |
matsko
added a commit
that referenced
this pull request
Sep 24, 2015
Some animations make use of the `from` and `to` styling only for the lifetime of the animation. This patch allows for those styles to be removed once the animation is closed automatically within `$animateCss`. Closes #12930
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.
Some animations make use of the
from
andto
styling only for thelifetime of the animation. This patch allows for those styles to be
removed once the animation is closed automatically within
$animateCss
.This demo showcases a clear need for this feature:
http://plnkr.co/edit/uuTz4eudDvKgspOowEPm?p=preview
Notice how we need to do cleanup work once the animation is complete by removing the height property:
With this new feature we could turn the code above into this: