Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"remove" method on instance #635

Merged
merged 3 commits into from Oct 12, 2020
Merged

"remove" method on instance #635

merged 3 commits into from Oct 12, 2020

Conversation

DarkAce65
Copy link
Contributor

Piggybacking off of #501, this adds a remove method to each anime instance so that individual animations and timelines can be controlled more precisely. The new remove method accepts any valid target in the same way as the global anime.remove(targets) but only affects the instance (and children of the instance) that it is called on.

The docs have also been updated to show both methods.

Semi-related issues: #318 #286.

@@ -1141,20 +1146,24 @@ function removeTargetsFromAnimations(targetsArray, animations) {
}
}

function removeTargets(targets) {
function removeTargetsFromInstance(targetsArray, instance) {
const animations = instance.animations;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all the same logic as before, just moved to a separate function for reuse

@juliangarnier juliangarnier changed the base branch from master to v3.2.1 October 12, 2020 13:23
@juliangarnier juliangarnier merged commit 4ea2ca2 into juliangarnier:v3.2.1 Oct 12, 2020
@juliangarnier
Copy link
Owner

Nice PR, and thanks for updating the doc accordingly.
Will be release in 3.2.1!

@DarkAce65 DarkAce65 deleted the instance-remove branch June 22, 2021 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants