Tom Cruise spotted at ‘Mission: Impossible’ screenings in Dallas. Here’s where

window.deltaScrollConfig = { thresholds: [100, 300], buffer: 0, scrollWait: 50, initialScroll: null, scrollEventCount: 0, thresholdsReached: {} }; window.debounce = function(func, wait) { let timeout; return function(...args) { clearTimeout(timeout); timeout = setTimeout(() => func.apply(this, args), wait); }; } window.debouncedScrollEvent = null; function trackScrollEvent() { const config = window.deltaScrollConfig; if (config.scrollEventCount < config.buffer) { config.scrollEventCount += 1; return; } const currentScroll = window.scrollY; // Check if initialScroll is null to set it the first time so we only set it when it hasn't been initialized yet // Using null avoids false positives from valid scroll positions like 0 if (config.initialScroll === null) { config.initialScroll = currentScroll; } else { const delta = Math.abs(currentScroll - config.initialScroll); config.thresholds.forEach((threshold) => { if (delta >= threshold && !config.thresholdsReached[threshold]) { window.dataLayer = window.dataLayer || []; // This keeps original naming for the 300px threshold since it is already in use. // @todo: Remove the following conditional once GTM is updated with new name. if (threshold === 300) { window.dataLayer.push({ event: '_scrolled_delta' }); } window.dataLayer.push({ event: '_scrolled_delta_' + threshold + 'px', threshold: threshold }); config.thresholdsReached[threshold] = true; // Update initialScroll after firing an event to reset the delta calculation for the next threshold config.initialScroll = currentScroll; } }); } if (Object.keys(config.thresholdsReached).length === config.thresholds.length) { window.removeEventListener('scroll', window.debouncedScrollEvent); } } // @see https://.blueconic.com/hc/en-us/articles/202605221-JavaScript-front-end-API#h_01HD28B475743B4021J1AQ0CTN function handleBlueConicLoad() { window.removeEventListener('onBlueConicLoaded', handleBlueConicLoad, false); window.debouncedScrollEvent = window.debounce(trackScrollEvent, window.deltaScrollConfig.scrollWait); window.addEventListener('scroll', window.debouncedScrollEvent, { ive: true }); } window.addEventListener('onBlueConicLoaded', handleBlueConicLoad, false);