const isResizedDocument = t396__revalidateDimensions();
514 if (!isResizedDocument) return; 516 t396__getZeroBlocks().forEach(function (zeroBlock) { 517 const { record } = zeroBlock; 519 if (!t396_isBlockVisible(record)) return; 522 t396_doResize(record.id.replace('rec', '')); 524 console.error(`Error trying to resize ${record.id}`, error); 528 document.dispatchEvent(new CustomEvent('zero:window-width-changed')); 531 'global_resize_zero_unique_id' 535function t396__onOrientationChange() { 536 t396_waitForFinalEvent( 538 t396__updateWindowDimensions(); 540 t396__getZeroBlocks().forEach(function (zeroBlock) { 541 var record = zeroBlock.record; 544 if (!t396_isBlockVisible(record)) return; 545 t396_doResize(record.id.replace('rec', '')); 549 'global_orientationchange_zero_unique_id' 553function t396_isOnlyScalableBrowser() { 554 return window.isOnlyScalable; 557function t396__setGlobalScaleVariables(recid, resolution, isScaled) { 558 const DEFAULT_SCALE = 1; 560 const rec = document.getElementById('rec' + recid); 561 const artBoard = rec ? rec.querySelector('.t396__artboard') : null; 562 if (!artBoard) return DEFAULT_SCALE; 564 const windowWidth = t396_ab__getWindowWidth(artBoard); 565 const scaleFactor = isScaled ? parseFloat((windowWidth / resolution).toFixed(3)) : DEFAULT_SCALE; 567 const artBoardId = 'ab' + recid; 568 window.tn[artBoardId].scaleFactor = scaleFactor; 569 window.tn_scale_factor = scaleFactor; 571 var record = document.getElementById('rec' + recid); 572 if (record && !window.tn.isEditMode) record.style.setProperty('--zoom', scaleFactor.toString()); 579 * @param {HTMLElement} artBoard 580 * @param {string} recid - record ID 581 * @param {Boolean } isResize 583function t396__processTopShift(artBoard, recid, isResize) { 585 typeof window.t396__updateTopShift === 'function' && 586 (t396_ab__getFieldValue(artBoard, 'shift-processed') === 'y' || 587 t396_ab__getFieldValue(artBoard, 'fixed-shift') === 'y') 589 window.t396__updateTopShift(recid, isResize); 593function t396_doResize(recid, shouldUpdateWindowWidth) { 594 if (shouldUpdateWindowWidth) { 595 t396__updateWindowDimensions(); 598 var isOnlyScalable = t396_isOnlyScalableBrowser(); 599 var record = document.getElementById('rec' + recid); 600 var allRecords = document.getElementById('allrecords');