MCPcopy
hub / github.com/greensock/GSAP / _merge

Function _merge

esm/GSDevTools.js:322–345  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

320},
321 //moves everything from _globalTimeline into _recordedRoot and updates the _rootTween if it is currently controlling the Global timeline (_recordedRoot). _recordedTemp is just a temporary recording area for anything that happens while _recordedRoot is paused. Returns true if the _recordedRoot's duration changed due to the merge.
322_merge = function _merge() {
323 var t = _globalTimeline._first,
324 duration,
325 next,
326 target;
327
328 if (_rootInstance) {
329 duration = _recordedRoot._dur;
330
331 while (t) {
332 next = t._next;
333 target = t._targets && t._targets[0];
334
335 if (!(_isFunction(target) && target === t.vars.onComplete && !t._dur) && !(target && target._gsIgnore)) {
336 //typically, delayedCalls aren't included in the _recordedTemp, but since the hijacked add() below fires BEFORE TweenLite's constructor sets the target, we couldn't check that target === vars.onComplete there. And Draggable creates a tween with just an onComplete (no onReverseComplete), thus it fails that test. Therefore, we test again here to avoid merging that in.
337 _recordedRoot.add(t, t._start - t._delay);
338 }
339
340 t = next;
341 }
342
343 return duration !== _recordedRoot.duration();
344 }
345},
346 _updateRootDuration = function _updateRootDuration() {
347 if (_rootInstance) {
348 _rootInstance.update();

Callers 4

_initCoreFunction · 0.70
animationFunction · 0.70
initializeFunction · 0.70
GSDevToolsFunction · 0.70

Calls 3

durationMethod · 0.80
_isFunctionFunction · 0.70
addMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…