Skip to content

Commit

Permalink
Bring back removeSubject/removeSubjects
Browse files Browse the repository at this point in the history
  • Loading branch information
David Aurelio committed Nov 21, 2012
1 parent eeaacf6 commit 52ff91e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/runner/animation/keyframe_animation.js
Expand Up @@ -377,6 +377,33 @@ define([
return this;
},

/**
* Removes a subject from the animation
*
* @param {Object} subject The subject to remove
*/
removeSubject: function(subject) {
for (var i = 0, l = this.subjects.length; i < l; ++i) {
if (this.subjects[i].subject === subject) {
this.subjects.splice(i, 1);
for (var a = 0, al = this.animations.length; a < al; ++a) {
this.animations[a].removeSubject(subject);
}
}
}
},

/**
* Removes a subject from the animation
*
* @param {Object[]} subjects Array of subjects to remove (usually display objects)
* @return {KeyframeAnimation}
*/
removeSubjects: function(subjects) {
forEach(subjects, tools.hitch(this, 'removeSubject'));
return this;
},

/**
* Creates a PropertiesTween object for each phase of the keyframe animation.
* Note that the startValues may have undefined properties, these need to be
Expand Down

3 comments on commit 52ff91e

@pvdz
Copy link

@pvdz pvdz commented on 52ff91e Nov 21, 2012

Choose a reason for hiding this comment

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

I think you've yet to fix this.animations?

@davidaurelio
Copy link
Contributor

Choose a reason for hiding this comment

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

@pvdz
Copy link

@pvdz pvdz commented on 52ff91e Nov 21, 2012

Choose a reason for hiding this comment

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

Okay missed that. Cool

Please sign in to comment.