Skip to content
Open
Show file tree
Hide file tree
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
16 changes: 10 additions & 6 deletions src/Animator.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ MathBox.Animator.prototype = {
}

// Stop all animations on the given keys
animator.stop(this, stop);
animator.stop(this, stop, true);
}

// Pass through to Attributes
Expand All @@ -74,7 +74,7 @@ MathBox.Animator.prototype = {
factor = factor || 4;

// Reduce
_.each(keys || object.__queue, function (queue, key) {
_.each(keys || object.__queue, function (key) {
_.each(object.__queue[key], function (op) {
op.hurry(factor);
});
Expand All @@ -84,11 +84,11 @@ MathBox.Animator.prototype = {
/**
* Stop all animations on an object.
*/
stop: function (object, keys) {
// Dequeue all animations, applying instantly.
_.each(keys || object.__queue, function (queue, key) {
stop: function (object, keys, apply) {
// Dequeue all animations, applying if requested.
_.each(keys || object.__queue, function (key) {
while (object.__queue[key]) {
this.dequeue(object, key, true);
this.dequeue(object, key, apply);
}
}.bind(this));
},
Expand All @@ -105,6 +105,10 @@ MathBox.Animator.prototype = {
this.attach(object);

_.each(attributes, function (value, key) {
if (options.immediately) {
this.stop(object, [key], false);
}

// Init queue if necessary.
var queue = object.__queue[key] = object.__queue[key] || [];

Expand Down
4 changes: 2 additions & 2 deletions src/Stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ MathBox.Stage.prototype = _.extend(MathBox.Stage.prototype, {
var animator = this.animator;

_.each(this.select(selector, true), function (primitive) {
animator.stop(primitive, keys);
primitive.style && animator.stop(primitive.style, keys);
animator.stop(primitive, keys, true);
primitive.style && animator.stop(primitive.style, keys, true);
});

return this;
Expand Down