Permalink
Browse files

Makes _recalculateAnimationLength private. v.0.9.8.

  • Loading branch information...
1 parent ce2c20f commit aeefbd30432b6262922d7d4cfe53ceab1d444f9e @jeremyckahn jeremyckahn committed Jun 21, 2012
Showing with 46 additions and 54 deletions.
  1. +1 −3 demo/bubbles.html
  2. +3 −3 dist/rekapi.bundle.min.js
  3. +20 −23 dist/rekapi.js
  4. +2 −2 dist/rekapi.min.js
  5. +3 −2 src/rekapi.actor.js
  6. +16 −20 src/rekapi.core.js
  7. +1 −1 version.txt
View
@@ -114,9 +114,7 @@
time = generateRandomFrame(bubbles[i], time);
}
- bubbles[i]
- .copyProperties(time += 1500, 0)
- .wait(time += 750);
+ bubbles[i].copyProperties(time += 1500, 0);
}
}
Oops, something went wrong.
View
@@ -1,6 +1,6 @@
/*jslint browser: true, nomen: true, plusplus: true, undef: true, vars: true, white: true */
/**
- * Rekapi - Rewritten Kapi. v0.9.7 (Wed, 20 Jun 2012 05:50:07 GMT)
+ * Rekapi - Rewritten Kapi. v0.9.8 (Thu, 21 Jun 2012 03:38:37 GMT)
* https://github.com/jeremyckahn/rekapi
*
* By Jeremy Kahn (jeremyckahn@gmail.com), with significant contributions from
@@ -30,6 +30,20 @@ function fireEvent (kapi, eventName, _, opt_data) {
/**
+ * @param {Kapi} kapi
+ */
+function recalculateAnimationLength (kapi) {
+ var actorLengths = [];
+
+ _.each(kapi._actors, function (actor) {
+ actorLengths.push(actor.getEnd());
+ });
+
+ kapi._animationLength = Math.max.apply(Math, actorLengths);
+};
+
+
+/**
* Does nothing. Absolutely nothing at all.
*/
function noop () {
@@ -296,24 +310,6 @@ var rekapiCore = function (context, _, Tweenable) {
/**
- * @private
- *
- * @return {Kapi}
- */
- Kapi.prototype._recalculateAnimationLength = function () {
- var actorLengths = [];
-
- _.each(this._actors, function (actor) {
- actorLengths.push(actor.getEnd());
- });
-
- this._animationLength = Math.max.apply(Math, actorLengths);
-
- return this;
- };
-
-
- /**
* @param {Kapi.Actor} actor
* @return {Kapi}
*/
@@ -327,7 +323,7 @@ var rekapiCore = function (context, _, Tweenable) {
actor.kapi = this;
actor.fps = this.framerate();
this._actors[actor.id] = actor;
- this._recalculateAnimationLength();
+ recalculateAnimationLength(this);
actor.setup();
fireEvent(this, 'addActor', _, actor);
@@ -370,7 +366,7 @@ var rekapiCore = function (context, _, Tweenable) {
delete this._actors[actor.id];
delete actor.kapi;
actor.teardown();
- this._recalculateAnimationLength();
+ recalculateAnimationLength(this);
fireEvent(this, 'removeActor', _, actor);
@@ -874,7 +870,7 @@ var rekapiActor = function (context, _, Tweenable) {
}, this);
if (this.kapi) {
- this.kapi._recalculateAnimationLength();
+ recalculateAnimationLength(this.kapi);
}
invalidatePropertyCache(this);
@@ -911,6 +907,7 @@ var rekapiActor = function (context, _, Tweenable) {
sortPropertyTracks(this);
invalidatePropertyCache(this);
+ recalculateAnimationLength(this.kapi);
return this;
};
@@ -1112,7 +1109,7 @@ var rekapiActor = function (context, _, Tweenable) {
}, this);
if (this.kapi) {
- this.kapi._recalculateAnimationLength();
+ recalculateAnimationLength(this.kapi);
}
invalidatePropertyCache(this);
View
Oops, something went wrong.
View
@@ -257,7 +257,7 @@ var rekapiActor = function (context, _, Tweenable) {
}, this);
if (this.kapi) {
- this.kapi._recalculateAnimationLength();
+ recalculateAnimationLength(this.kapi);
}
invalidatePropertyCache(this);
@@ -294,6 +294,7 @@ var rekapiActor = function (context, _, Tweenable) {
sortPropertyTracks(this);
invalidatePropertyCache(this);
+ recalculateAnimationLength(this.kapi);
return this;
};
@@ -495,7 +496,7 @@ var rekapiActor = function (context, _, Tweenable) {
}, this);
if (this.kapi) {
- this.kapi._recalculateAnimationLength();
+ recalculateAnimationLength(this.kapi);
}
invalidatePropertyCache(this);
View
@@ -16,6 +16,20 @@ function fireEvent (kapi, eventName, _, opt_data) {
/**
+ * @param {Kapi} kapi
+ */
+function recalculateAnimationLength (kapi) {
+ var actorLengths = [];
+
+ _.each(kapi._actors, function (actor) {
+ actorLengths.push(actor.getEnd());
+ });
+
+ kapi._animationLength = Math.max.apply(Math, actorLengths);
+};
+
+
+/**
* Does nothing. Absolutely nothing at all.
*/
function noop () {
@@ -282,24 +296,6 @@ var rekapiCore = function (context, _, Tweenable) {
/**
- * @private
- *
- * @return {Kapi}
- */
- Kapi.prototype._recalculateAnimationLength = function () {
- var actorLengths = [];
-
- _.each(this._actors, function (actor) {
- actorLengths.push(actor.getEnd());
- });
-
- this._animationLength = Math.max.apply(Math, actorLengths);
-
- return this;
- };
-
-
- /**
* @param {Kapi.Actor} actor
* @return {Kapi}
*/
@@ -313,7 +309,7 @@ var rekapiCore = function (context, _, Tweenable) {
actor.kapi = this;
actor.fps = this.framerate();
this._actors[actor.id] = actor;
- this._recalculateAnimationLength();
+ recalculateAnimationLength(this);
actor.setup();
fireEvent(this, 'addActor', _, actor);
@@ -356,7 +352,7 @@ var rekapiCore = function (context, _, Tweenable) {
delete this._actors[actor.id];
delete actor.kapi;
actor.teardown();
- this._recalculateAnimationLength();
+ recalculateAnimationLength(this);
fireEvent(this, 'removeActor', _, actor);
View
@@ -1 +1 @@
-0.9.7
+0.9.8

0 comments on commit aeefbd3

Please sign in to comment.