| 1211 | }, |
| 1212 | //TIMESCALE button |
| 1213 | onChangeTimeScale = function onChangeTimeScale(e) { |
| 1214 | var ts = parseFloat(timeScale.options[timeScale.selectedIndex].value) || 1, |
| 1215 | target; |
| 1216 | linkedAnimation.timeScale(ts); |
| 1217 | record("timeScale", ts); |
| 1218 | |
| 1219 | if (!paused) { |
| 1220 | if (linkedAnimation.progress() >= outProgress / 100) { |
| 1221 | target = linkedAnimation._targets && linkedAnimation._targets[0]; |
| 1222 | |
| 1223 | if (target === selectedAnimation) { |
| 1224 | //in case there are callbacks on the timeline, when we jump back to the start we should seek() so that the playhead doesn't drag [backward] past those and trigger them. |
| 1225 | target.seek(startTime + (endTime - startTime) * inProgress / 100); |
| 1226 | } |
| 1227 | |
| 1228 | linkedAnimation.progress(inProgress / 100, true).pause(); |
| 1229 | } else { |
| 1230 | linkedAnimation.pause(); |
| 1231 | } |
| 1232 | |
| 1233 | _delayedCall(0.01, function () { |
| 1234 | return linkedAnimation.resume(); |
| 1235 | }); |
| 1236 | } |
| 1237 | |
| 1238 | timeScaleLabel.innerHTML = ts + "x"; |
| 1239 | |
| 1240 | if (timeScale.blur) { |
| 1241 | //so that if an option is selected, and then the user tries to hit the up/down arrow, it doesn't just try selecting something else in the <select>. |
| 1242 | timeScale.blur(); |
| 1243 | } |
| 1244 | }, |
| 1245 | //AUTOHIDE |
| 1246 | autoHideTween = gsap.to([find(".gs-bottom"), find(".gs-top")], { |
| 1247 | duration: 0.3, |