* * @param {HTMLElement} rec - current record * @param {number} contentHeight - height of content without padding */function t_cover__setRecalculatedHeight(rec, contentHeight) { var coverCarrier = rec.querySelector('.t-cover__carrier'); var coverCarrierHeight = coverCarrier ? coverCarrier.getAttribute('data-content-cover-height') : ''; if (!coverCarrierHeight) { var coverHeightElem = rec.querySelector('[data-content-cover-height]'); coverCarrierHeight = coverHeightElem ? coverHeightElem.getAttribute('data-content-cover-height') : '0'; } var setByUserHeight = t_cover__getHeightFromAttr(coverCarrierHeight); var isDynamicParallax = coverCarrier ? coverCarrier.getAttribute('data-content-cover-parallax') === 'dynamic' : ''; const recordType = t_cover__getRecordType(rec); const isCR30N = recordType === '734'; const isTS208 = recordType === '942'; var contentHeightPadding = window.innerWidth <= 568 ? 40 : 120; var contentHeightExtraPadding = window.innerWidth <= 568 ? 50 : 100; if (isCR30N || isTS208) { contentHeightPadding = 0; contentHeightExtraPadding = 0; } const isScaled = t_cover__isScaled(rec); const zoomValue = isScaled ? parseFloat(getComputedStyle(rec).getPropertyValue('zoom')) || 1 : 1; if (isScaled) { contentHeight *= zoomValue; contentHeight += contentHeightPadding / zoomValue; if (contentHeight > 1000) contentHeight += contentHeightExtraPadding / zoomValue; } else { contentHeight += contentHeightPadding; if (contentHeight > 1000) contentHeight += contentHeightExtraPadding; } var finishHeight = contentHeight > setByUserHeight ? contentHeight : setByUserHeight; var heightPadding = 0; var selectorsList = ['.t-cover', '.t-cover__filter', '.t-cover__carrier', '.t-cover__wrapper']; // for support CR30N (querySelector need for Edit-mode) if (isCR30N || rec.querySelector('.t734')) selectorsList.push('.t-slds__items-wrapper'); if (isScaled && contentHeight === finishHeight) finishHeight /= zoomValue; const needProcessScale = isScaled && finishHeight === setByUserHeight; selectorsList.forEach(function (selector) { // block CR30N has more than one cover carrier var elementList = Array.prototype.slice.call(rec.querySelectorAll(selector)); elementList.forEach(function (element) { if ( isDynamicParallax && element && element.classList.contains('t-cover__carrier') && finishHeight < document.documentElement.clientHeight ) { heightPadding = document.documentElement.clientHeight * 0.2; const finalHeight = finishHeight + heightPadding + 'px'; element.style.height = needProcessScale ? `calc(${finalHeight} / var(--t-zoom, 1))` : finalHeight; } else if (element) { element.style.height = needProcessScale ? `calc(${finishHeight}px / var(--t-zoom, 1))` : finishHeight + 'px'; } }); }); coverCarrier.setAttribute('data-content-cover-updated-height', finishHeight + heightPadding + 'px'); var event = document.createEvent('Event'); event.initEvent('coverHeightUpdated', true, true); coverCarrier.dispatchEvent(event);}function t_cover__getRecordType(rec) { if (!rec) return ''; return ( rec.getAttribute('data-parenttplid') || rec.getAttribute('data-record-type') || rec.closest('.record')?.getAttribute('data-parenttplid') || rec.closest('.record')?.getAttribute('data-record-type') || '' );}/** * @param {HTMLElement} rec - element which can be contains element .t-cover__carrier */function t_cover__updateResizeElem(rec) { var allRec = document.getElementById('allrecords');