greensock-rails 1.19.1.2 → 1.20.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c791e8e0f48d3e721853845fec466754e5e4e8e5
4
- data.tar.gz: 10dda1a0b941939868199136c8545d9f6649100a
3
+ metadata.gz: 0beb82880b4e5da47109982f12de4543a65dbde3
4
+ data.tar.gz: 832ef660ecb89cd46a0fceeaeac0d5988b0b840d
5
5
  SHA512:
6
- metadata.gz: ca289a53bb574310d5c8bc251683159e1e81ca2d7a8955aec3dd39640f395f4095874872dc7d765ff13d63a98a21d09148c6dc37a7e71d62475ad2dfd542e9f1
7
- data.tar.gz: e5d312e24581b22cc9005fd3c75223faf445323acba1e3c7bfb444b7e9dd50fdb556c8f2ce21afb9a44a2ca330b9a5787899f8396374d4953909bda56ca0bf47
6
+ metadata.gz: 5bfa3ac136639204daf1ad05e0d0117dcdc66b7e9872d709fc009ace2bfadc67bdd4270f05fe12347ff4e2590656649a25e83da613f314a622d26fbde04f13c0
7
+ data.tar.gz: 4d349c80728866940b8f4818e3a102f96122c4003c59d5eb6fab3eaf0f325f44aa5d1656bd9b2fd0c1229ab71fabe8258f8de2f223bbf3d39ded6827e9e7e1c1
@@ -1,5 +1,5 @@
1
1
  module Greensock
2
2
  module Rails
3
- VERSION = "1.19.1.2"
3
+ VERSION = "1.20.0.0"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 1.19.1
3
- * DATE: 2017-01-17
2
+ * VERSION: 1.20.0
3
+ * DATE: 2017-06-27
4
4
  * UPDATES AND DOCS AT: http://greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
@@ -69,7 +69,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
69
69
  },
70
70
  p = TimelineLite.prototype = new SimpleTimeline();
71
71
 
72
- TimelineLite.version = "1.19.1";
72
+ TimelineLite.version = "1.20.0";
73
73
  p.constructor = TimelineLite;
74
74
  p.kill()._gc = p._forcingPlayhead = p._hasPause = false;
75
75
 
@@ -233,6 +233,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
233
233
 
234
234
  SimpleTimeline.prototype.add.call(this, value, position);
235
235
 
236
+ if (value._time) { //in case, for example, the _startTime is moved on a tween that has already rendered. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning.
237
+ value.render((this.rawTime() - value._startTime) * value._timeScale, false, false);
238
+ }
239
+
236
240
  //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate.
237
241
  if (this._gc || this._time === this._duration) if (!this._paused) if (this._duration < this.duration()) {
238
242
  //in case any of the ancestors had completed but should now be enabled...
@@ -316,7 +320,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
316
320
  };
317
321
 
318
322
  p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) {
319
- var i;
323
+ var clippedDuration, i;
320
324
  //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration().
321
325
  if (ignore instanceof Animation && ignore.timeline === this) {
322
326
  this.remove(ignore);
@@ -328,22 +332,23 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
328
332
  }
329
333
  }
330
334
  }
335
+ clippedDuration = (this.duration() > 99999999999) ? this.recent().endTime(false) : this._duration; //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead.
331
336
  if (typeof(offsetOrLabel) === "string") {
332
- return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - this.duration() : 0, appendIfAbsent);
337
+ return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - clippedDuration : 0, appendIfAbsent);
333
338
  }
334
339
  offsetOrLabel = offsetOrLabel || 0;
335
340
  if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value).
336
341
  i = timeOrLabel.indexOf("=");
337
342
  if (i === -1) {
338
343
  if (this._labels[timeOrLabel] == null) {
339
- return appendIfAbsent ? (this._labels[timeOrLabel] = this.duration() + offsetOrLabel) : offsetOrLabel;
344
+ return appendIfAbsent ? (this._labels[timeOrLabel] = clippedDuration + offsetOrLabel) : offsetOrLabel;
340
345
  }
341
346
  return this._labels[timeOrLabel] + offsetOrLabel;
342
347
  }
343
348
  offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1));
344
- timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : this.duration();
349
+ timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : clippedDuration;
345
350
  } else if (timeOrLabel == null) {
346
- timeOrLabel = this.duration();
351
+ timeOrLabel = clippedDuration;
347
352
  }
348
353
  return Number(timeOrLabel) + offsetOrLabel;
349
354
  };
@@ -772,10 +777,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
772
777
  var getGlobal = function() {
773
778
  return (_gsScope.GreenSockGlobals || _gsScope)[name];
774
779
  };
775
- if (typeof(define) === "function" && define.amd) { //AMD
776
- define(["TweenLite"], getGlobal);
777
- } else if (typeof(module) !== "undefined" && module.exports) { //node
780
+ if (typeof(module) !== "undefined" && module.exports) { //node
778
781
  require("./TweenLite.js"); //dependency
779
782
  module.exports = getGlobal();
783
+ } else if (typeof(define) === "function" && define.amd) { //AMD
784
+ define(["TweenLite"], getGlobal);
780
785
  }
781
786
  }("TimelineLite"));
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 1.19.1
3
- * DATE: 2017-01-17
2
+ * VERSION: 1.20.0
3
+ * DATE: 2017-06-27
4
4
  * UPDATES AND DOCS AT: http://greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
@@ -34,7 +34,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
34
34
 
35
35
  p.constructor = TimelineMax;
36
36
  p.kill()._gc = false;
37
- TimelineMax.version = "1.19.1";
37
+ TimelineMax.version = "1.20.0";
38
38
 
39
39
  p.invalidate = function() {
40
40
  this._yoyo = (this.vars.yoyo === true);
@@ -445,11 +445,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
445
445
  //---- GETTERS / SETTERS -------------------------------------------------------------------------------------------------------
446
446
 
447
447
  p.progress = function(value, suppressEvents) {
448
- return (!arguments.length) ? this._time / this.duration() : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents);
448
+ return (!arguments.length) ? (this._time / this.duration()) || 0 : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents);
449
449
  };
450
450
 
451
451
  p.totalProgress = function(value, suppressEvents) {
452
- return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, suppressEvents);
452
+ return (!arguments.length) ? (this._totalTime / this.totalDuration()) || 0 : this.totalTime( this.totalDuration() * value, suppressEvents);
453
453
  };
454
454
 
455
455
  p.totalDuration = function(value) {
@@ -584,7 +584,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
584
584
  },
585
585
  p = TimelineLite.prototype = new SimpleTimeline();
586
586
 
587
- TimelineLite.version = "1.19.1";
587
+ TimelineLite.version = "1.20.0";
588
588
  p.constructor = TimelineLite;
589
589
  p.kill()._gc = p._forcingPlayhead = p._hasPause = false;
590
590
 
@@ -748,6 +748,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
748
748
 
749
749
  SimpleTimeline.prototype.add.call(this, value, position);
750
750
 
751
+ if (value._time) { //in case, for example, the _startTime is moved on a tween that has already rendered. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning.
752
+ value.render((this.rawTime() - value._startTime) * value._timeScale, false, false);
753
+ }
754
+
751
755
  //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate.
752
756
  if (this._gc || this._time === this._duration) if (!this._paused) if (this._duration < this.duration()) {
753
757
  //in case any of the ancestors had completed but should now be enabled...
@@ -831,7 +835,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
831
835
  };
832
836
 
833
837
  p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) {
834
- var i;
838
+ var clippedDuration, i;
835
839
  //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration().
836
840
  if (ignore instanceof Animation && ignore.timeline === this) {
837
841
  this.remove(ignore);
@@ -843,22 +847,23 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
843
847
  }
844
848
  }
845
849
  }
850
+ clippedDuration = (this.duration() > 99999999999) ? this.recent().endTime(false) : this._duration; //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead.
846
851
  if (typeof(offsetOrLabel) === "string") {
847
- return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - this.duration() : 0, appendIfAbsent);
852
+ return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - clippedDuration : 0, appendIfAbsent);
848
853
  }
849
854
  offsetOrLabel = offsetOrLabel || 0;
850
855
  if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value).
851
856
  i = timeOrLabel.indexOf("=");
852
857
  if (i === -1) {
853
858
  if (this._labels[timeOrLabel] == null) {
854
- return appendIfAbsent ? (this._labels[timeOrLabel] = this.duration() + offsetOrLabel) : offsetOrLabel;
859
+ return appendIfAbsent ? (this._labels[timeOrLabel] = clippedDuration + offsetOrLabel) : offsetOrLabel;
855
860
  }
856
861
  return this._labels[timeOrLabel] + offsetOrLabel;
857
862
  }
858
863
  offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1));
859
- timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : this.duration();
864
+ timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : clippedDuration;
860
865
  } else if (timeOrLabel == null) {
861
- timeOrLabel = this.duration();
866
+ timeOrLabel = clippedDuration;
862
867
  }
863
868
  return Number(timeOrLabel) + offsetOrLabel;
864
869
  };
@@ -1286,10 +1291,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1286
1291
  var getGlobal = function() {
1287
1292
  return (_gsScope.GreenSockGlobals || _gsScope)[name];
1288
1293
  };
1289
- if (typeof(define) === "function" && define.amd) { //AMD
1290
- define(["TweenLite"], getGlobal);
1291
- } else if (typeof(module) !== "undefined" && module.exports) { //node
1294
+ if (typeof(module) !== "undefined" && module.exports) { //node
1292
1295
  require("./TweenLite.js"); //dependency
1293
1296
  module.exports = getGlobal();
1297
+ } else if (typeof(define) === "function" && define.amd) { //AMD
1298
+ define(["TweenLite"], getGlobal);
1294
1299
  }
1295
1300
  }("TimelineMax"));
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 1.19.1
3
- * DATE: 2017-01-17
2
+ * VERSION: 1.20.0
3
+ * DATE: 2017-06-13
4
4
  * UPDATES AND DOCS AT: http://greensock.com
5
5
  *
6
6
  * @license Copyright (c) 2008-2017, GreenSock. All rights reserved.
@@ -88,7 +88,7 @@
88
88
  this.check = function(init) {
89
89
  var i = dependencies.length,
90
90
  missing = i,
91
- cur, a, n, cl, hasModule;
91
+ cur, a, n, cl;
92
92
  while (--i > -1) {
93
93
  if ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) {
94
94
  _classes[i] = cur.gsClass;
@@ -105,10 +105,7 @@
105
105
  //exports to multiple environments
106
106
  if (global) {
107
107
  _globals[n] = _exports[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.)
108
- hasModule = (typeof(module) !== "undefined" && module.exports);
109
- if (!hasModule && typeof(define) === "function" && define.amd){ //AMD
110
- define((window.GreenSockAMDPath ? window.GreenSockAMDPath + "/" : "") + ns.split(".").pop(), [], function() { return cl; });
111
- } else if (hasModule){ //node
108
+ if (typeof(module) !== "undefined" && module.exports) {
112
109
  if (ns === moduleName) {
113
110
  module.exports = _exports[moduleName] = cl;
114
111
  for (i in _exports) {
@@ -117,6 +114,8 @@
117
114
  } else if (_exports[moduleName]) {
118
115
  _exports[moduleName][n] = cl;
119
116
  }
117
+ } else if (typeof(define) === "function" && define.amd){ //AMD
118
+ define((window.GreenSockAMDPath ? window.GreenSockAMDPath + "/" : "") + ns.split(".").pop(), [], function() { return cl; });
120
119
  }
121
120
  }
122
121
  for (i = 0; i < this.sc.length; i++) {
@@ -440,10 +439,14 @@
440
439
 
441
440
  //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker.
442
441
  var _checkTimeout = function() {
443
- if (_tickerActive && _getTime() - _lastUpdate > 2000) {
442
+ if (_tickerActive && _getTime() - _lastUpdate > 2000 && _doc.visibilityState !== "hidden") {
444
443
  _ticker.wake();
445
444
  }
446
- setTimeout(_checkTimeout, 2000);
445
+ var t = setTimeout(_checkTimeout, 2000);
446
+ if (t.unref) {
447
+ // allows a node process to exit even if the timeout’s callback hasn't been invoked. Without it, the node process could hang as this function is called every two seconds.
448
+ t.unref();
449
+ }
447
450
  };
448
451
  _checkTimeout();
449
452
 
@@ -502,7 +505,7 @@
502
505
  var tl = this._timeline, //the 2 root timelines won't have a _timeline; they're always active.
503
506
  startTime = this._startTime,
504
507
  rawTime;
505
- return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale));
508
+ return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale - 0.0000001));
506
509
  };
507
510
 
508
511
  p._enabled = function (enabled, ignoreTimeline) {
@@ -844,7 +847,7 @@
844
847
  this._totalTime = this._time = this._rawPrevTime = time;
845
848
  while (tween) {
846
849
  next = tween._next; //record it here because the value could change after rendering...
847
- if (tween._active || (time >= tween._startTime && !tween._paused)) {
850
+ if (tween._active || (time >= tween._startTime && !tween._paused && !tween._gc)) {
848
851
  if (!tween._reversed) {
849
852
  tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
850
853
  } else {
@@ -946,7 +949,7 @@
946
949
  p._firstPT = p._targets = p._overwrittenProps = p._startAt = null;
947
950
  p._notifyPluginsOfEnabled = p._lazy = false;
948
951
 
949
- TweenLite.version = "1.19.1";
952
+ TweenLite.version = "1.20.0";
950
953
  TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1);
951
954
  TweenLite.defaultOverwrite = "auto";
952
955
  TweenLite.ticker = _ticker;
@@ -967,13 +970,14 @@
967
970
  var _lazyTweens = [],
968
971
  _lazyLookup = {},
969
972
  _numbersExp = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,
973
+ _relExp = /[\+-]=-?[\.\d]/,
970
974
  //_nonNumbersExp = /(?:([\-+](?!(\d|=)))|[^\d\-+=e]|(e(?![\-+][\d])))+/ig,
971
975
  _setRatio = function(v) {
972
976
  var pt = this._firstPT,
973
977
  min = 0.000001,
974
978
  val;
975
979
  while (pt) {
976
- val = !pt.blob ? pt.c * v + pt.s : (v === 1) ? this.end : v ? this.join("") : this.start;
980
+ val = !pt.blob ? pt.c * v + pt.s : (v === 1 && this.end) ? this.end : v ? this.join("") : this.start;
977
981
  if (pt.m) {
978
982
  val = pt.m(val, this._target || pt.t);
979
983
  } else if (val < min) if (val > -min && !pt.blob) { //prevents issues with converting very small numbers to strings in the browser
@@ -1043,6 +1047,9 @@
1043
1047
  a.push(s);
1044
1048
  }
1045
1049
  a.setRatio = _setRatio;
1050
+ if (_relExp.test(end)) { //if the end string contains relative values, delete it so that on the final render (in _setRatio()), we don't actually set it to the string with += or -= characters (forces it to use the calculated value).
1051
+ a.end = 0;
1052
+ }
1046
1053
  return a;
1047
1054
  },
1048
1055
  //note: "funcParam" is only necessary for function-based getters/setters that require an extra parameter like getAttribute("width") and setAttribute("width", value). In this example, funcParam would be "width". Used by AttrPlugin for example.
@@ -1061,7 +1068,7 @@
1061
1068
  if (funcParam || isNaN(s) || (!isRelative && isNaN(end)) || typeof(s) === "boolean" || typeof(end) === "boolean") {
1062
1069
  //a blob (string that has multiple numbers in it)
1063
1070
  pt.fp = funcParam;
1064
- blob = _blobDif(s, (isRelative ? pt.s + pt.c : end), stringFilter || TweenLite.defaultStringFilter, pt);
1071
+ blob = _blobDif(s, (isRelative ? parseFloat(pt.s) + pt.c : end), stringFilter || TweenLite.defaultStringFilter, pt);
1065
1072
  pt = {t: blob, p: "setRatio", s: 0, c: 1, f: 2, pg: 0, n: overwriteProp || prop, pr: 0, m: 0}; //"2" indicates it's a Blob property tween. Needed for RoundPropsPlugin for example.
1066
1073
  } else {
1067
1074
  pt.s = parseFloat(s);
@@ -1082,7 +1089,7 @@
1082
1089
  _plugins = TweenLite._plugins = {},
1083
1090
  _tweenLookup = _internals.tweenLookup = {},
1084
1091
  _tweenLookupNum = 0,
1085
- _reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1, id:1},
1092
+ _reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1, id:1, yoyoEase:1},
1086
1093
  _overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, "true":1, "false":0},
1087
1094
  _rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(),
1088
1095
  _rootTimeline = Animation._rootTimeline = new SimpleTimeline(),
@@ -1267,6 +1274,8 @@
1267
1274
  startVars.immediateRender = true;
1268
1275
  startVars.lazy = (immediate && v.lazy !== false);
1269
1276
  startVars.startAt = startVars.delay = null; //no nesting of startAt objects allowed (otherwise it could cause an infinite loop).
1277
+ startVars.onUpdate = v.onUpdate;
1278
+ startVars.onUpdateScope = v.onUpdateScope || v.callbackScope || this;
1270
1279
  this._startAt = TweenLite.to(this.target, 0, startVars);
1271
1280
  if (immediate) {
1272
1281
  if (this._time > 0) {
@@ -1450,7 +1459,7 @@
1450
1459
  this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
1451
1460
  }
1452
1461
  }
1453
- if (!this._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately.
1462
+ if (!this._initted || (this._startAt && this._startAt.progress())) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. Also, we check progress() because if startAt has already rendered at its end, we should force a render at its beginning. Otherwise, if you put the playhead directly on top of where a fromTo({immediateRender:false}) starts, and then move it backwards, the from() won't revert its values.
1454
1463
  force = true;
1455
1464
  }
1456
1465
  } else {
@@ -1741,7 +1750,7 @@
1741
1750
  }
1742
1751
  }
1743
1752
  }
1744
- } else {
1753
+ } else if (target._gsTweenID) {
1745
1754
  a = _register(target).concat();
1746
1755
  i = a.length;
1747
1756
  while (--i > -1) {
@@ -1750,7 +1759,7 @@
1750
1759
  }
1751
1760
  }
1752
1761
  }
1753
- return a;
1762
+ return a || [];
1754
1763
  };
1755
1764
 
1756
1765
  TweenLite.killTweensOf = TweenLite.killDelayedCallsTo = function(target, onlyActive, vars) {
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * VERSION: 1.19.1
3
- * DATE: 2017-01-17
2
+ * VERSION: 1.20.0
3
+ * DATE: 2017-06-27
4
4
  * UPDATES AND DOCS AT: http://greensock.com
5
5
  *
6
6
  * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin
@@ -37,7 +37,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
37
37
  TweenMax = function(target, duration, vars) {
38
38
  TweenLite.call(this, target, duration, vars);
39
39
  this._cycle = 0;
40
- this._yoyo = (this.vars.yoyo === true);
40
+ this._yoyo = (this.vars.yoyo === true || !!this.vars.yoyoEase);
41
41
  this._repeat = this.vars.repeat || 0;
42
42
  this._repeatDelay = this.vars.repeatDelay || 0;
43
43
  this._dirty = true; //ensures that if there is any repeat, the totalDuration will get recalculated to accurately report it.
@@ -50,7 +50,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
50
50
  p = TweenMax.prototype = TweenLite.to({}, 0.1, {}),
51
51
  _blankArray = [];
52
52
 
53
- TweenMax.version = "1.19.1";
53
+ TweenMax.version = "1.20.0";
54
54
  p.constructor = TweenMax;
55
55
  p.kill()._gc = false;
56
56
  TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf;
@@ -60,9 +60,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
60
60
  TweenMax.render = TweenLite.render;
61
61
 
62
62
  p.invalidate = function() {
63
- this._yoyo = (this.vars.yoyo === true);
63
+ this._yoyo = (this.vars.yoyo === true || !!this.vars.yoyoEase);
64
64
  this._repeat = this.vars.repeat || 0;
65
65
  this._repeatDelay = this.vars.repeatDelay || 0;
66
+ this._yoyoEase = null;
66
67
  this._uncache(true);
67
68
  return TweenLite.prototype.invalidate.call(this);
68
69
  };
@@ -130,7 +131,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
130
131
  prevCycle = this._cycle,
131
132
  duration = this._duration,
132
133
  prevRawPrevTime = this._rawPrevTime,
133
- isComplete, callback, pt, cycleDuration, r, type, pow, rawPrevTime;
134
+ isComplete, callback, pt, cycleDuration, r, type, pow, rawPrevTime, yoyoEase;
134
135
  if (time >= totalDur - 0.0000001 && time >= 0) { //to work around occasional floating point math artifacts.
135
136
  this._totalTime = totalDur;
136
137
  this._cycle = this._repeat;
@@ -189,6 +190,18 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
189
190
  this._time = this._totalTime - (this._cycle * cycleDuration);
190
191
  if (this._yoyo) if ((this._cycle & 1) !== 0) {
191
192
  this._time = duration - this._time;
193
+ yoyoEase = this._yoyoEase || this.vars.yoyoEase; //note: we don't set this._yoyoEase in _init() like we do other properties because it's TweenMax-specific and doing it here allows us to optimize performance (most tweens don't have a yoyoEase). Note that we also must skip the this.ratio calculation further down right after we _init() in this function, because we're doing it here.
194
+ if (yoyoEase) {
195
+ if (!this._yoyoEase) {
196
+ if (yoyoEase === true && !this._initted) { //if it's not initted and yoyoEase is true, this._ease won't have been populated yet so we must discern it here.
197
+ yoyoEase = this.vars.ease;
198
+ this._yoyoEase = yoyoEase = !yoyoEase ? TweenLite.defaultEase : (yoyoEase instanceof Ease) ? yoyoEase : (typeof(yoyoEase) === "function") ? new Ease(yoyoEase, this.vars.easeParams) : Ease.map[yoyoEase] || TweenLite.defaultEase;
199
+ } else {
200
+ this._yoyoEase = yoyoEase = (yoyoEase === true) ? this._ease : (yoyoEase instanceof Ease) ? yoyoEase : Ease.map[yoyoEase];
201
+ }
202
+ }
203
+ this.ratio = yoyoEase ? 1 - yoyoEase.getRatio((duration - this._time) / duration) : 0;
204
+ }
192
205
  }
193
206
  if (this._time > duration) {
194
207
  this._time = duration;
@@ -197,7 +210,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
197
210
  }
198
211
  }
199
212
 
200
- if (this._easeType) {
213
+ if (this._easeType && !yoyoEase) {
201
214
  r = this._time / duration;
202
215
  type = this._easeType;
203
216
  pow = this._easePower;
@@ -227,7 +240,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
227
240
  this.ratio = 1 - (r / 2);
228
241
  }
229
242
 
230
- } else {
243
+ } else if (!yoyoEase) {
231
244
  this.ratio = this._ease.getRatio(this._time / duration);
232
245
  }
233
246
 
@@ -252,9 +265,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
252
265
  return;
253
266
  }
254
267
  //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently.
255
- if (this._time && !isComplete) {
268
+ if (this._time && !isComplete && !yoyoEase) {
256
269
  this.ratio = this._ease.getRatio(this._time / duration);
257
- } else if (isComplete && this._ease._calcEnd) {
270
+ } else if (isComplete && this._ease._calcEnd && !yoyoEase) {
258
271
  this.ratio = this._ease.getRatio((this._time === 0) ? 0 : 1);
259
272
  }
260
273
  }
@@ -687,7 +700,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
687
700
  },
688
701
  p = TimelineLite.prototype = new SimpleTimeline();
689
702
 
690
- TimelineLite.version = "1.19.1";
703
+ TimelineLite.version = "1.20.0";
691
704
  p.constructor = TimelineLite;
692
705
  p.kill()._gc = p._forcingPlayhead = p._hasPause = false;
693
706
 
@@ -851,6 +864,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
851
864
 
852
865
  SimpleTimeline.prototype.add.call(this, value, position);
853
866
 
867
+ if (value._time) { //in case, for example, the _startTime is moved on a tween that has already rendered. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning.
868
+ value.render((this.rawTime() - value._startTime) * value._timeScale, false, false);
869
+ }
870
+
854
871
  //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate.
855
872
  if (this._gc || this._time === this._duration) if (!this._paused) if (this._duration < this.duration()) {
856
873
  //in case any of the ancestors had completed but should now be enabled...
@@ -934,7 +951,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
934
951
  };
935
952
 
936
953
  p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) {
937
- var i;
954
+ var clippedDuration, i;
938
955
  //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration().
939
956
  if (ignore instanceof Animation && ignore.timeline === this) {
940
957
  this.remove(ignore);
@@ -946,22 +963,23 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
946
963
  }
947
964
  }
948
965
  }
966
+ clippedDuration = (this.duration() > 99999999999) ? this.recent().endTime(false) : this._duration; //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead.
949
967
  if (typeof(offsetOrLabel) === "string") {
950
- return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - this.duration() : 0, appendIfAbsent);
968
+ return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - clippedDuration : 0, appendIfAbsent);
951
969
  }
952
970
  offsetOrLabel = offsetOrLabel || 0;
953
971
  if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value).
954
972
  i = timeOrLabel.indexOf("=");
955
973
  if (i === -1) {
956
974
  if (this._labels[timeOrLabel] == null) {
957
- return appendIfAbsent ? (this._labels[timeOrLabel] = this.duration() + offsetOrLabel) : offsetOrLabel;
975
+ return appendIfAbsent ? (this._labels[timeOrLabel] = clippedDuration + offsetOrLabel) : offsetOrLabel;
958
976
  }
959
977
  return this._labels[timeOrLabel] + offsetOrLabel;
960
978
  }
961
979
  offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1));
962
- timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : this.duration();
980
+ timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : clippedDuration;
963
981
  } else if (timeOrLabel == null) {
964
- timeOrLabel = this.duration();
982
+ timeOrLabel = clippedDuration;
965
983
  }
966
984
  return Number(timeOrLabel) + offsetOrLabel;
967
985
  };
@@ -1418,7 +1436,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1418
1436
 
1419
1437
  p.constructor = TimelineMax;
1420
1438
  p.kill()._gc = false;
1421
- TimelineMax.version = "1.19.1";
1439
+ TimelineMax.version = "1.20.0";
1422
1440
 
1423
1441
  p.invalidate = function() {
1424
1442
  this._yoyo = (this.vars.yoyo === true);
@@ -1829,11 +1847,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
1829
1847
  //---- GETTERS / SETTERS -------------------------------------------------------------------------------------------------------
1830
1848
 
1831
1849
  p.progress = function(value, suppressEvents) {
1832
- return (!arguments.length) ? this._time / this.duration() : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents);
1850
+ return (!arguments.length) ? (this._time / this.duration()) || 0 : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents);
1833
1851
  };
1834
1852
 
1835
1853
  p.totalProgress = function(value, suppressEvents) {
1836
- return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, suppressEvents);
1854
+ return (!arguments.length) ? (this._totalTime / this.totalDuration()) || 0 : this.totalTime( this.totalDuration() * value, suppressEvents);
1837
1855
  };
1838
1856
 
1839
1857
  p.totalDuration = function(value) {
@@ -2033,7 +2051,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2033
2051
  }
2034
2052
  l = values.length - 2;
2035
2053
  if (l < 0) {
2036
- a[0] = new Segment(values[0][p], 0, 0, values[(l < -1) ? 0 : 1][p]);
2054
+ a[0] = new Segment(values[0][p], 0, 0, values[0][p]);
2037
2055
  return a;
2038
2056
  }
2039
2057
  for (i = 0; i < l; i++) {
@@ -2219,7 +2237,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2219
2237
  BezierPlugin = _gsScope._gsDefine.plugin({
2220
2238
  propName: "bezier",
2221
2239
  priority: -1,
2222
- version: "1.3.7",
2240
+ version: "1.3.8",
2223
2241
  API: 2,
2224
2242
  global:true,
2225
2243
 
@@ -2545,7 +2563,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2545
2563
  p = CSSPlugin.prototype = new TweenPlugin("css");
2546
2564
 
2547
2565
  p.constructor = CSSPlugin;
2548
- CSSPlugin.version = "1.19.1";
2566
+ CSSPlugin.version = "1.20.0";
2549
2567
  CSSPlugin.API = 2;
2550
2568
  CSSPlugin.defaultTransformPerspective = 0;
2551
2569
  CSSPlugin.defaultSkewType = "compensated";
@@ -2678,7 +2696,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2678
2696
  * @return {number} value in pixels
2679
2697
  */
2680
2698
  _convertToPixels = _internals.convertToPixels = function(t, p, v, sfx, recurse) {
2681
- if (sfx === "px" || !sfx) { return v; }
2699
+ if (sfx === "px" || (!sfx && p !== "lineHeight")) { return v; }
2682
2700
  if (sfx === "auto" || !v) { return 0; }
2683
2701
  var horiz = _horizExp.test(p),
2684
2702
  node = t,
@@ -2692,12 +2710,20 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
2692
2710
  if (precise) {
2693
2711
  v *= 100;
2694
2712
  }
2695
- if (sfx === "%" && p.indexOf("border") !== -1) {
2713
+ if (p === "lineHeight" && !sfx) { //special case of when a simple lineHeight (without a unit) is used. Set it to the value, read back the computed value, and then revert.
2714
+ cache = _getComputedStyle(t).lineHeight;
2715
+ t.style.lineHeight = v;
2716
+ pix = parseFloat(_getComputedStyle(t).lineHeight);
2717
+ t.style.lineHeight = cache;
2718
+ } else if (sfx === "%" && p.indexOf("border") !== -1) {
2696
2719
  pix = (v / 100) * (horiz ? t.clientWidth : t.clientHeight);
2697
2720
  } else {
2698
2721
  style.cssText = "border:0 solid red;position:" + _getStyle(t, "position") + ";line-height:0;";
2699
2722
  if (sfx === "%" || !node.appendChild || sfx.charAt(0) === "v" || sfx === "rem") {
2700
2723
  node = t.parentNode || _doc.body;
2724
+ if (_getStyle(node, "display").indexOf("flex") !== -1) { //Edge and IE11 have a bug that causes offsetWidth to report as 0 if the container has display:flex and the child is position:relative. Switching to position: absolute solves it.
2725
+ style.position = "absolute";
2726
+ }
2701
2727
  cache = node._gsCache;
2702
2728
  time = TweenLite.ticker.frame;
2703
2729
  if (cache && horiz && cache.time === time) { //performance optimization: we record the width of elements along with the ticker frame so that we can quickly get it again on the same tick (seems relatively safe to assume it wouldn't change on the same tick)
@@ -3046,8 +3072,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3046
3072
  _formatColors = function(s, toHSL) {
3047
3073
  var colors = s.match(_colorExp) || [],
3048
3074
  charIndex = 0,
3049
- parsed = colors.length ? "" : s,
3075
+ parsed = "",
3050
3076
  i, color, temp;
3077
+ if (!colors.length) {
3078
+ return s;
3079
+ }
3051
3080
  for (i = 0; i < colors.length; i++) {
3052
3081
  color = colors[i];
3053
3082
  temp = s.substr(charIndex, s.indexOf(color, charIndex)-charIndex);
@@ -3068,7 +3097,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3068
3097
  _colorExp = new RegExp(_colorExp+")", "gi");
3069
3098
 
3070
3099
  CSSPlugin.colorStringFilter = function(a) {
3071
- var combined = a[0] + a[1],
3100
+ var combined = a[0] + " " + a[1],
3072
3101
  toHSL;
3073
3102
  if (_colorExp.test(combined)) {
3074
3103
  toHSL = (combined.indexOf("hsl(") !== -1 || combined.indexOf("hsla(") !== -1);
@@ -3408,6 +3437,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3408
3437
  str = ev.indexOf(")") + 1;
3409
3438
  str = ")" + (str ? ev.substr(str) : ""); //if there's a comma or ) at the end, retain it.
3410
3439
  useHSL = (ev.indexOf("hsl") !== -1 && _supportsOpacity);
3440
+ temp = ev; //original string value so we can look for any prefix later.
3411
3441
  bv = _parseColor(bv, useHSL);
3412
3442
  ev = _parseColor(ev, useHSL);
3413
3443
  hasAlpha = (bv.length + ev.length > 6);
@@ -3419,11 +3449,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3419
3449
  hasAlpha = false;
3420
3450
  }
3421
3451
  if (useHSL) {
3422
- pt.appendXtra((hasAlpha ? "hsla(" : "hsl("), bv[0], _parseChange(ev[0], bv[0]), ",", false, true)
3452
+ pt.appendXtra(temp.substr(0, temp.indexOf("hsl")) + (hasAlpha ? "hsla(" : "hsl("), bv[0], _parseChange(ev[0], bv[0]), ",", false, true)
3423
3453
  .appendXtra("", bv[1], _parseChange(ev[1], bv[1]), "%,", false)
3424
3454
  .appendXtra("", bv[2], _parseChange(ev[2], bv[2]), (hasAlpha ? "%," : "%" + str), false);
3425
3455
  } else {
3426
- pt.appendXtra((hasAlpha ? "rgba(" : "rgb("), bv[0], ev[0] - bv[0], ",", true, true)
3456
+ pt.appendXtra(temp.substr(0, temp.indexOf("rgb")) + (hasAlpha ? "rgba(" : "rgb("), bv[0], ev[0] - bv[0], ",", true, true)
3427
3457
  .appendXtra("", bv[1], ev[1] - bv[1], ",", true)
3428
3458
  .appendXtra("", bv[2], ev[2] - bv[2], (hasAlpha ? "," : str), true);
3429
3459
  }
@@ -3841,8 +3871,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3841
3871
  s = (s && s.length === 4) ? [s[0].substr(4), Number(s[2].substr(4)), Number(s[1].substr(4)), s[3].substr(4), (tm.x || 0), (tm.y || 0)].join(",") : "";
3842
3872
  }
3843
3873
  isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)");
3844
- if (isDefault && _transformProp && ((none = (_getComputedStyle(e).display === "none")) || !e.parentNode)) {
3845
- if (none) { //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not "none".
3874
+ if (_transformProp && ((none = (_getComputedStyle(e).display === "none")) || !e.parentNode)) {
3875
+ if (none) { //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not "none". Firefox and Microsoft browsers have a partial bug where they'll report transforms even if display:none BUT not any percentage-based values like translate(-50%, 8px) will be reported as if it's translate(0, 8px).
3846
3876
  n = style.display;
3847
3877
  style.display = "block";
3848
3878
  }
@@ -3927,7 +3957,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3927
3957
  a43 = m[11],
3928
3958
  angle = Math.atan2(a32, a33),
3929
3959
  t1, t2, t3, t4, cos, sin;
3930
-
3931
3960
  //we manually compensate for non-zero z component of transformOrigin to work around bugs in Safari
3932
3961
  if (tm.zOrigin) {
3933
3962
  a34 = -tm.zOrigin;
@@ -3935,6 +3964,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3935
3964
  a24 = a23*a34-m[13];
3936
3965
  a34 = a33*a34+tm.zOrigin-m[14];
3937
3966
  }
3967
+ //note for possible future consolidation: rotationX: Math.atan2(a32, a33), rotationY: Math.atan2(-a31, Math.sqrt(a33 * a33 + a32 * a32)), rotation: Math.atan2(a21, a11), skew: Math.atan2(a12, a22). However, it doesn't seem to be quite as reliable as the full-on backwards rotation procedure.
3938
3968
  tm.rotationX = angle * _RAD2DEG;
3939
3969
  //rotationX
3940
3970
  if (angle) {
@@ -3971,13 +4001,17 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3971
4001
  angle = Math.atan2(a21, a11);
3972
4002
  tm.rotation = angle * _RAD2DEG;
3973
4003
  if (angle) {
3974
- cos = Math.cos(-angle);
3975
- sin = Math.sin(-angle);
3976
- a11 = a11*cos+a12*sin;
3977
- t2 = a21*cos+a22*sin;
3978
- a22 = a21*-sin+a22*cos;
3979
- a32 = a31*-sin+a32*cos;
3980
- a21 = t2;
4004
+ cos = Math.cos(angle);
4005
+ sin = Math.sin(angle);
4006
+ t1 = a11*cos+a21*sin;
4007
+ t2 = a12*cos+a22*sin;
4008
+ t3 = a13*cos+a23*sin;
4009
+ a21 = a21*cos-a11*sin;
4010
+ a22 = a22*cos-a12*sin;
4011
+ a23 = a23*cos-a13*sin;
4012
+ a11 = t1;
4013
+ a12 = t2;
4014
+ a13 = t3;
3981
4015
  }
3982
4016
 
3983
4017
  if (tm.rotationX && Math.abs(tm.rotationX) + Math.abs(tm.rotation) > 359.9) { //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here.
@@ -3985,24 +4019,46 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
3985
4019
  tm.rotationY = 180 - tm.rotationY;
3986
4020
  }
3987
4021
 
3988
- tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21) * rnd + 0.5) | 0) / rnd;
3989
- tm.scaleY = ((Math.sqrt(a22 * a22 + a23 * a23) * rnd + 0.5) | 0) / rnd;
3990
- tm.scaleZ = ((Math.sqrt(a32 * a32 + a33 * a33) * rnd + 0.5) | 0) / rnd;
3991
- if (tm.rotationX || tm.rotationY) {
3992
- tm.skewX = 0;
3993
- } else {
3994
- tm.skewX = (a12 || a22) ? Math.atan2(a12, a22) * _RAD2DEG + tm.rotation : tm.skewX || 0;
3995
- if (Math.abs(tm.skewX) > 90 && Math.abs(tm.skewX) < 270) {
3996
- if (invX) {
3997
- tm.scaleX *= -1;
3998
- tm.skewX += (tm.rotation <= 0) ? 180 : -180;
3999
- tm.rotation += (tm.rotation <= 0) ? 180 : -180;
4000
- } else {
4001
- tm.scaleY *= -1;
4002
- tm.skewX += (tm.skewX <= 0) ? 180 : -180;
4003
- }
4022
+ //skewX
4023
+ angle = Math.atan2(a12, a22);
4024
+
4025
+ //scales
4026
+ tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21 + a31 * a31) * rnd + 0.5) | 0) / rnd;
4027
+ tm.scaleY = ((Math.sqrt(a22 * a22 + a32 * a32) * rnd + 0.5) | 0) / rnd;
4028
+ tm.scaleZ = ((Math.sqrt(a13 * a13 + a23 * a23 + a33 * a33) * rnd + 0.5) | 0) / rnd;
4029
+ a11 /= tm.scaleX;
4030
+ a12 /= tm.scaleY;
4031
+ a21 /= tm.scaleX;
4032
+ a22 /= tm.scaleY;
4033
+ if (Math.abs(angle) > min) {
4034
+ tm.skewX = angle * _RAD2DEG;
4035
+ a12 = 0; //unskews
4036
+ if (tm.skewType !== "simple") {
4037
+ tm.scaleY *= 1 / Math.cos(angle); //by default, we compensate the scale based on the skew so that the element maintains a similar proportion when skewed, so we have to alter the scaleY here accordingly to match the default (non-adjusted) skewing that CSS does (stretching more and more as it skews).
4004
4038
  }
4039
+
4040
+ } else {
4041
+ tm.skewX = 0;
4005
4042
  }
4043
+
4044
+ /* //for testing purposes
4045
+ var transform = "matrix3d(",
4046
+ comma = ",",
4047
+ zero = "0";
4048
+ a13 /= tm.scaleZ;
4049
+ a23 /= tm.scaleZ;
4050
+ a31 /= tm.scaleX;
4051
+ a32 /= tm.scaleY;
4052
+ a33 /= tm.scaleZ;
4053
+ transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31);
4054
+ transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22);
4055
+ transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13);
4056
+ transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma;
4057
+ transform += a14 + comma + a24 + comma + a34 + comma + (tm.perspective ? (1 + (-a34 / tm.perspective)) : 1) + ")";
4058
+ console.log(transform);
4059
+ document.querySelector(".test").style[_transformProp] = transform;
4060
+ */
4061
+
4006
4062
  tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0;
4007
4063
  tm.x = a14;
4008
4064
  tm.y = a24;
@@ -4024,16 +4080,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
4024
4080
  scaleY = Math.sqrt(d * d + c * c);
4025
4081
  rotation = (a || b) ? Math.atan2(b, a) * _RAD2DEG : tm.rotation || 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist).
4026
4082
  skewX = (c || d) ? Math.atan2(c, d) * _RAD2DEG + rotation : tm.skewX || 0;
4027
- if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {
4028
- if (invX) {
4029
- scaleX *= -1;
4030
- skewX += (rotation <= 0) ? 180 : -180;
4031
- rotation += (rotation <= 0) ? 180 : -180;
4032
- } else {
4033
- scaleY *= -1;
4034
- skewX += (skewX <= 0) ? 180 : -180;
4035
- }
4036
- }
4037
4083
  tm.scaleX = scaleX;
4038
4084
  tm.scaleY = scaleY;
4039
4085
  tm.rotation = rotation;
@@ -4048,6 +4094,16 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
4048
4094
  tm.y -= tm.yOrigin - (tm.xOrigin * b + tm.yOrigin * d);
4049
4095
  }
4050
4096
  }
4097
+ if (Math.abs(tm.skewX) > 90 && Math.abs(tm.skewX) < 270) {
4098
+ if (invX) {
4099
+ tm.scaleX *= -1;
4100
+ tm.skewX += (tm.rotation <= 0) ? 180 : -180;
4101
+ tm.rotation += (tm.rotation <= 0) ? 180 : -180;
4102
+ } else {
4103
+ tm.scaleY *= -1;
4104
+ tm.skewX += (tm.skewX <= 0) ? 180 : -180;
4105
+ }
4106
+ }
4051
4107
  tm.zOrigin = zOrigin;
4052
4108
  //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 0 in these cases. The conditional logic here is faster than calling Math.abs(). Also, browsers tend to render a SLIGHTLY rotated object in a fuzzy way, so we need to snap to exactly 0 when appropriate.
4053
4109
  for (i in tm) {
@@ -4281,7 +4337,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
4281
4337
  a11 = a22 = 1;
4282
4338
  a12 = a21 = 0;
4283
4339
  }
4284
- // KEY INDEX AFFECTS
4340
+ // KEY INDEX AFFECTS a[row][column]
4285
4341
  // a11 0 rotation, rotationY, scaleX
4286
4342
  // a21 1 rotation, rotationY, scaleX
4287
4343
  // a31 2 rotationY, scaleX
@@ -4417,6 +4473,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
4417
4473
  m1 = _getTransform(t, _cs, true, v.parseTransform),
4418
4474
  orig = v.transform && ((typeof(v.transform) === "function") ? v.transform(_index, _target) : v.transform),
4419
4475
  m2, copy, has3D, hasChange, dr, x, y, matrix, p;
4476
+ m1.skewType = v.skewType || m1.skewType || CSSPlugin.defaultSkewType;
4420
4477
  cssp._transform = m1;
4421
4478
  if (orig && typeof(orig) === "string" && _transformProp) { //for values like transform:"rotate(60deg) scale(0.5, 0.8)"
4422
4479
  copy = _tempDiv.style; //don't use the original target because it might be SVG in which case some browsers don't report computed style correctly.
@@ -4425,6 +4482,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
4425
4482
  copy.position = "absolute";
4426
4483
  _doc.body.appendChild(_tempDiv);
4427
4484
  m2 = _getTransform(_tempDiv, null, false);
4485
+ if (m1.skewType === "simple") { //the default _getTransform() reports the skewX/scaleY as if skewType is "compensated", thus we need to adjust that here if skewType is "simple".
4486
+ m2.scaleY *= Math.cos(m2.skewX * _DEG2RAD);
4487
+ }
4428
4488
  if (m1.svg) { //if it's an SVG element, x/y part of the matrix will be affected by whatever we use as the origin and the offsets, so compensate here...
4429
4489
  x = m1.xOrigin;
4430
4490
  y = m1.yOrigin;
@@ -4496,8 +4556,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
4496
4556
  hasChange = true;
4497
4557
  }
4498
4558
 
4499
- m1.skewType = v.skewType || m1.skewType || CSSPlugin.defaultSkewType;
4500
-
4501
4559
  has3D = (m1.force3D || m1.z || m1.rotationX || m1.rotationY || m2.z || m2.rotationX || m2.rotationY || m2.perspective);
4502
4560
  if (!has3D && v.scale != null) {
4503
4561
  m2.scaleZ = 1; //no need to tween scaleZ.
@@ -5005,7 +5063,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
5005
5063
  sp = _specialProps[p]; //SpecialProp lookup.
5006
5064
  if (sp) {
5007
5065
  pt = sp.parse(target, es, p, this, pt, plugin, vars);
5008
-
5066
+ } else if (p.substr(0,2) === "--") { //for tweening CSS variables (which always start with "--"). To maximize performance and simplicity, we bypass CSSPlugin altogether and just add a normal property tween to the tween instance itself.
5067
+ this._tween._propLookup[p] = this._addTween.call(this._tween, target.style, "setProperty", _getComputedStyle(target).getPropertyValue(p) + "", es + "", p, false, p);
5068
+ continue;
5009
5069
  } else {
5010
5070
  bs = _getStyle(target, p, _cs) + "";
5011
5071
  isStr = (typeof(es) === "string");
@@ -5052,9 +5112,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
5052
5112
  }
5053
5113
 
5054
5114
  es = (en || en === 0) ? (rel ? en + bn : en) + esfx : vars[p]; //ensures that any += or -= prefixes are taken care of. Record the end value before normalizing the suffix because we always want to end the tween on exactly what they intended even if it doesn't match the beginning value's suffix.
5055
-
5056
5115
  //if the beginning/ending suffixes don't match, normalize them...
5057
- if (bsfx !== esfx) if (esfx !== "") if (en || en === 0) if (bn) { //note: if the beginning value (bn) is 0, we don't need to convert units!
5116
+ if (bsfx !== esfx) if (esfx !== "" || p === "lineHeight") if (en || en === 0) if (bn) { //note: if the beginning value (bn) is 0, we don't need to convert units!
5058
5117
  bn = _convertToPixels(target, p, bn, bsfx);
5059
5118
  if (esfx === "%") {
5060
5119
  bn /= _convertToPixels(target, p, 100, "%") / 100;
@@ -5476,7 +5535,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
5476
5535
  _gsScope._gsDefine.plugin({
5477
5536
  propName: "attr",
5478
5537
  API: 2,
5479
- version: "0.6.0",
5538
+ version: "0.6.1",
5480
5539
 
5481
5540
  //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
5482
5541
  init: function(target, value, tween, index) {
@@ -5515,7 +5574,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
5515
5574
  */
5516
5575
  _gsScope._gsDefine.plugin({
5517
5576
  propName: "directionalRotation",
5518
- version: "0.3.0",
5577
+ version: "0.3.1",
5519
5578
  API: 2,
5520
5579
 
5521
5580
  //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run.
@@ -5694,10 +5753,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
5694
5753
 
5695
5754
 
5696
5755
  //SteppedEase
5697
- SteppedEase = _class("easing.SteppedEase", function(steps) {
5756
+ SteppedEase = _class("easing.SteppedEase", function(steps, immediateStart) {
5698
5757
  steps = steps || 1;
5699
5758
  this._p1 = 1 / steps;
5700
- this._p2 = steps + 1;
5759
+ this._p2 = steps + (immediateStart ? 0 : 1);
5760
+ this._p3 = immediateStart ? 1 : 0;
5701
5761
  }, true);
5702
5762
  p = SteppedEase.prototype = new Ease();
5703
5763
  p.constructor = SteppedEase;
@@ -5707,10 +5767,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
5707
5767
  } else if (p >= 1) {
5708
5768
  p = 0.999999999;
5709
5769
  }
5710
- return ((this._p2 * p) >> 0) * this._p1;
5770
+ return (((this._p2 * p) | 0) + this._p3) * this._p1;
5711
5771
  };
5712
- p.config = SteppedEase.config = function(steps) {
5713
- return new SteppedEase(steps);
5772
+ p.config = SteppedEase.config = function(steps, immediateStart) {
5773
+ return new SteppedEase(steps, immediateStart);
5714
5774
  };
5715
5775
 
5716
5776
 
@@ -6023,7 +6083,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6023
6083
  this.check = function(init) {
6024
6084
  var i = dependencies.length,
6025
6085
  missing = i,
6026
- cur, a, n, cl, hasModule;
6086
+ cur, a, n, cl;
6027
6087
  while (--i > -1) {
6028
6088
  if ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) {
6029
6089
  _classes[i] = cur.gsClass;
@@ -6040,10 +6100,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6040
6100
  //exports to multiple environments
6041
6101
  if (global) {
6042
6102
  _globals[n] = _exports[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.)
6043
- hasModule = (typeof(module) !== "undefined" && module.exports);
6044
- if (!hasModule && typeof(define) === "function" && define.amd){ //AMD
6045
- define((window.GreenSockAMDPath ? window.GreenSockAMDPath + "/" : "") + ns.split(".").pop(), [], function() { return cl; });
6046
- } else if (hasModule){ //node
6103
+ if (typeof(module) !== "undefined" && module.exports) { //node
6047
6104
  if (ns === moduleName) {
6048
6105
  module.exports = _exports[moduleName] = cl;
6049
6106
  for (i in _exports) {
@@ -6052,6 +6109,8 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6052
6109
  } else if (_exports[moduleName]) {
6053
6110
  _exports[moduleName][n] = cl;
6054
6111
  }
6112
+ } else if (typeof(define) === "function" && define.amd){ //AMD
6113
+ define((window.GreenSockAMDPath ? window.GreenSockAMDPath + "/" : "") + ns.split(".").pop(), [], function() { return cl; });
6055
6114
  }
6056
6115
  }
6057
6116
  for (i = 0; i < this.sc.length; i++) {
@@ -6084,7 +6143,6 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6084
6143
  * ----------------------------------------------------------------
6085
6144
  */
6086
6145
  var _baseParams = [0, 0, 1, 1],
6087
- _blankArray = [],
6088
6146
  Ease = _class("easing.Ease", function(func, extraParams, type, power) {
6089
6147
  this._func = func;
6090
6148
  this._type = type || 0;
@@ -6375,10 +6433,14 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6375
6433
 
6376
6434
  //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker.
6377
6435
  var _checkTimeout = function() {
6378
- if (_tickerActive && _getTime() - _lastUpdate > 2000) {
6436
+ if (_tickerActive && _getTime() - _lastUpdate > 2000 && _doc.visibilityState !== "hidden") {
6379
6437
  _ticker.wake();
6380
6438
  }
6381
- setTimeout(_checkTimeout, 2000);
6439
+ var t = setTimeout(_checkTimeout, 2000);
6440
+ if (t.unref) {
6441
+ // allows a node process to exit even if the timeout’s callback hasn't been invoked. Without it, the node process could hang as this function is called every two seconds.
6442
+ t.unref();
6443
+ }
6382
6444
  };
6383
6445
  _checkTimeout();
6384
6446
 
@@ -6437,7 +6499,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6437
6499
  var tl = this._timeline, //the 2 root timelines won't have a _timeline; they're always active.
6438
6500
  startTime = this._startTime,
6439
6501
  rawTime;
6440
- return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale));
6502
+ return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale - 0.0000001));
6441
6503
  };
6442
6504
 
6443
6505
  p._enabled = function (enabled, ignoreTimeline) {
@@ -6779,7 +6841,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6779
6841
  this._totalTime = this._time = this._rawPrevTime = time;
6780
6842
  while (tween) {
6781
6843
  next = tween._next; //record it here because the value could change after rendering...
6782
- if (tween._active || (time >= tween._startTime && !tween._paused)) {
6844
+ if (tween._active || (time >= tween._startTime && !tween._paused && !tween._gc)) {
6783
6845
  if (!tween._reversed) {
6784
6846
  tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force);
6785
6847
  } else {
@@ -6881,7 +6943,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6881
6943
  p._firstPT = p._targets = p._overwrittenProps = p._startAt = null;
6882
6944
  p._notifyPluginsOfEnabled = p._lazy = false;
6883
6945
 
6884
- TweenLite.version = "1.19.1";
6946
+ TweenLite.version = "1.20.0";
6885
6947
  TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1);
6886
6948
  TweenLite.defaultOverwrite = "auto";
6887
6949
  TweenLite.ticker = _ticker;
@@ -6902,13 +6964,14 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6902
6964
  var _lazyTweens = [],
6903
6965
  _lazyLookup = {},
6904
6966
  _numbersExp = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,
6967
+ _relExp = /[\+-]=-?[\.\d]/,
6905
6968
  //_nonNumbersExp = /(?:([\-+](?!(\d|=)))|[^\d\-+=e]|(e(?![\-+][\d])))+/ig,
6906
6969
  _setRatio = function(v) {
6907
6970
  var pt = this._firstPT,
6908
6971
  min = 0.000001,
6909
6972
  val;
6910
6973
  while (pt) {
6911
- val = !pt.blob ? pt.c * v + pt.s : (v === 1) ? this.end : v ? this.join("") : this.start;
6974
+ val = !pt.blob ? pt.c * v + pt.s : (v === 1 && this.end) ? this.end : v ? this.join("") : this.start;
6912
6975
  if (pt.m) {
6913
6976
  val = pt.m(val, this._target || pt.t);
6914
6977
  } else if (val < min) if (val > -min && !pt.blob) { //prevents issues with converting very small numbers to strings in the browser
@@ -6978,6 +7041,9 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6978
7041
  a.push(s);
6979
7042
  }
6980
7043
  a.setRatio = _setRatio;
7044
+ if (_relExp.test(end)) { //if the end string contains relative values, delete it so that on the final render (in _setRatio()), we don't actually set it to the string with += or -= characters (forces it to use the calculated value).
7045
+ a.end = 0;
7046
+ }
6981
7047
  return a;
6982
7048
  },
6983
7049
  //note: "funcParam" is only necessary for function-based getters/setters that require an extra parameter like getAttribute("width") and setAttribute("width", value). In this example, funcParam would be "width". Used by AttrPlugin for example.
@@ -6996,7 +7062,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
6996
7062
  if (funcParam || isNaN(s) || (!isRelative && isNaN(end)) || typeof(s) === "boolean" || typeof(end) === "boolean") {
6997
7063
  //a blob (string that has multiple numbers in it)
6998
7064
  pt.fp = funcParam;
6999
- blob = _blobDif(s, (isRelative ? pt.s + pt.c : end), stringFilter || TweenLite.defaultStringFilter, pt);
7065
+ blob = _blobDif(s, (isRelative ? parseFloat(pt.s) + pt.c : end), stringFilter || TweenLite.defaultStringFilter, pt);
7000
7066
  pt = {t: blob, p: "setRatio", s: 0, c: 1, f: 2, pg: 0, n: overwriteProp || prop, pr: 0, m: 0}; //"2" indicates it's a Blob property tween. Needed for RoundPropsPlugin for example.
7001
7067
  } else {
7002
7068
  pt.s = parseFloat(s);
@@ -7017,7 +7083,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
7017
7083
  _plugins = TweenLite._plugins = {},
7018
7084
  _tweenLookup = _internals.tweenLookup = {},
7019
7085
  _tweenLookupNum = 0,
7020
- _reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1, id:1},
7086
+ _reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1, id:1, yoyoEase:1},
7021
7087
  _overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, "true":1, "false":0},
7022
7088
  _rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(),
7023
7089
  _rootTimeline = Animation._rootTimeline = new SimpleTimeline(),
@@ -7202,6 +7268,8 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
7202
7268
  startVars.immediateRender = true;
7203
7269
  startVars.lazy = (immediate && v.lazy !== false);
7204
7270
  startVars.startAt = startVars.delay = null; //no nesting of startAt objects allowed (otherwise it could cause an infinite loop).
7271
+ startVars.onUpdate = v.onUpdate;
7272
+ startVars.onUpdateScope = v.onUpdateScope || v.callbackScope || this;
7205
7273
  this._startAt = TweenLite.to(this.target, 0, startVars);
7206
7274
  if (immediate) {
7207
7275
  if (this._time > 0) {
@@ -7385,7 +7453,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
7385
7453
  this._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient.
7386
7454
  }
7387
7455
  }
7388
- if (!this._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately.
7456
+ if (!this._initted || (this._startAt && this._startAt.progress())) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. Also, we check progress() because if startAt has already rendered at its end, we should force a render at its beginning. Otherwise, if you put the playhead directly on top of where a fromTo({immediateRender:false}) starts, and then move it backwards, the from() won't revert its values.
7389
7457
  force = true;
7390
7458
  }
7391
7459
  } else {
@@ -7676,7 +7744,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
7676
7744
  }
7677
7745
  }
7678
7746
  }
7679
- } else {
7747
+ } else if (target._gsTweenID) {
7680
7748
  a = _register(target).concat();
7681
7749
  i = a.length;
7682
7750
  while (--i > -1) {
@@ -7685,7 +7753,7 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
7685
7753
  }
7686
7754
  }
7687
7755
  }
7688
- return a;
7756
+ return a || [];
7689
7757
  };
7690
7758
 
7691
7759
  TweenLite.killTweensOf = TweenLite.killDelayedCallsTo = function(target, onlyActive, vars) {