Skip to content

Commit

Permalink
Added NEXT libs and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanny McNie committed May 27, 2015
1 parent f6a3c5e commit 88e62d3
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 13 deletions.
Binary file modified docs/TweenJS_docs-NEXT.zip
Binary file not shown.
52 changes: 41 additions & 11 deletions lib/tweenjs-NEXT.combined.js
Original file line number Diff line number Diff line change
Expand Up @@ -1561,6 +1561,15 @@ this.createjs = this.createjs||{};
* @protected
*/
this._inited = false;

/**
* Indicates whether the tween is currently registered with Tween.
* @property _registered
* @type {boolean}
* @default false
* @protected
*/
this._registered = false;


if (props) {
Expand Down Expand Up @@ -1738,7 +1747,7 @@ this.createjs = this.createjs||{};
for (var i= 0, l=tweens.length; i<l; i++) {
var tween = tweens[i];
tween._paused = true;
tween.target.tweenjs_count = 0;
tween.target&&(tween.target.tweenjs_count = 0);
}
tweens.length = 0;
};
Expand All @@ -1752,7 +1761,7 @@ this.createjs = this.createjs||{};
* @static
*/
Tween.hasActiveTweens = function(target) {
if (target) { return target.tweenjs_count; }
if (target) { return target.tweenjs_count != null && !!target.tweenjs_count; }
return Tween._tweens && !!Tween._tweens.length;
};

Expand Down Expand Up @@ -1791,21 +1800,22 @@ this.createjs = this.createjs||{};
Tween._register = function(tween, value) {
var target = tween._target;
var tweens = Tween._tweens;
if (value) {
if (value && !tween._registered) {
// TODO: this approach might fail if a dev is using sealed objects in ES5
if (target) { target.tweenjs_count = target.tweenjs_count ? target.tweenjs_count+1 : 1; }
tweens.push(tween);
if (!Tween._inited && createjs.Ticker) { createjs.Ticker.addEventListener("tick", Tween); Tween._inited = true; }
} else {
} else if (!value && tween._registered) {
if (target) { target.tweenjs_count--; }
var i = tweens.length;
while (i--) {
if (tweens[i] == tween) {
tweens.splice(i, 1);
return;
break;
}
}
}
tween._registered = value;
};


Expand Down Expand Up @@ -1913,7 +1923,7 @@ this.createjs = this.createjs||{};
/**
* Queues an action to pause the specified tween.
* @method pause
* @param {Tween} tween The tween to play. If null, it pauses this tween.
* @param {Tween} tween The tween to pause. If null, it pauses this tween.
* @return {Tween} This tween instance (for chaining calls)
*/
p.pause = function(tween) {
Expand Down Expand Up @@ -2329,6 +2339,15 @@ this.createjs = this.createjs||{};
* @protected
**/
this._useTicks = false;

/**
* Indicates whether the timeline is currently registered with Tween.
* @property _registered
* @type {boolean}
* @default false
* @protected
*/
this._registered = false;


if (props) {
Expand Down Expand Up @@ -2508,8 +2527,7 @@ this.createjs = this.createjs||{};
* is `false`).
**/
p.setPosition = function(value, actionsMode) {
if (value < 0) { value = 0; }
var t = this.loop ? value%this.duration : value;
var t = this._calcPosition(value);
var end = !this.loop && value >= this.duration;
if (t == this._prevPos) { return end; }
this._prevPosition = value;
Expand All @@ -2529,7 +2547,7 @@ this.createjs = this.createjs||{};
* @param {Boolean} value Indicates whether the tween should be paused (`true`) or played (`false`).
**/
p.setPaused = function(value) {
this._paused = !!value;
this._paused = !!value;
createjs.Tween._register(this, !value);
};

Expand Down Expand Up @@ -2589,13 +2607,25 @@ this.createjs = this.createjs||{};
// private methods:
/**
* @method _goto
* @param {String | Number} positionOrLabel
* @protected
**/
p._goto = function(positionOrLabel) {
var pos = this.resolve(positionOrLabel);
if (pos != null) { this.setPosition(pos); }
};


/**
* @method _calcPosition
* @param {Number} value
* @return {Number}
* @protected
**/
p._calcPosition = function(value) {
if (value < 0) { return 0; }
if (value < this.duration) { return value; }
return this.loop ? value%this.duration : this.duration;
};

createjs.Timeline = createjs.promote(Timeline, "EventDispatcher");

Expand Down Expand Up @@ -3368,6 +3398,6 @@ this.createjs = this.createjs || {};
* @type String
* @static
**/
s.buildDate = /*=date*/"Thu, 12 Mar 2015 20:31:51 GMT"; // injected by build process
s.buildDate = /*=date*/"Wed, 27 May 2015 18:12:44 GMT"; // injected by build process

})();
Loading

0 comments on commit 88e62d3

Please sign in to comment.