Каталог файловtilda-scripts-3.0.js
1101 var elParent = el.closest('.r');1102 var computedStyle = entry.computedStyle;1103 var position = computedStyle.getPropertyValue('position');1104 if (position !== 'fixed' && position !== 'absolute') return;1105 1106 var duration = computedStyle.getPropertyValue('transition-duration');1107 if (duration.indexOf('ms') + 1) {1108 duration = parseInt(duration.replace('ms', ''), 10);1109 transitionDurations.push(duration);1110 } else if (duration.indexOf('s') + 1) {1111 duration = parseFloat(duration.replace('s', '')) * 1000;
История файла и сравнение версий
transitionDurations.push(duration);
1115 var computedRight = computedStyle.getPropertyValue('right'); 1116 computedRight = parseInt(computedRight.replace('px', ''), 10); 1118 var elementInlineRight = el.style.right; 1119 if (elementInlineRight) { 1120 el.setAttribute('data-tilda-initial-right', elementInlineRight); 1122 var inlineWidth = el.style.width; 1124 el.setAttribute('data-tilda-initial-width', inlineWidth); 1127 var elZoom = (elParent && parseFloat(getComputedStyle(elParent).getPropertyValue('zoom'))) || 1; 1128 var scrollBarValue = obj.scrollBarWidth / elZoom; 1130 var { isFullscreenWidth, isFullscreenHeight, computedMarginNum } = t_scrollBarWidthCompensator__checkSize( 1135 isFullscreenWidth || 1136 el.classList.contains('t-menu-popover_fullwidth') || 1137 (el.classList.contains('t-menu-popover') && elZoom > 1); 1139 (computedRight || computedRight === 0) && 1140 el.style.right !== 'auto' && 1141 position !== 'absolute' && 1144 el.style.right = scrollBarValue + computedRight + 'px'; 1145 } else if (isFullscreenWidth && !isFullscreenHeight) { 1146 el.style.width = `calc(100vw / ${window.isSafari ? 1 : elZoom} - ${computedMarginNum}px - ${scrollBarValue}px)`; 1150 if (transitionDurations.length) { 1151 obj.delay = Math.max.apply(null, transitionDurations); 1156 * Проверяет полноэкранный ли элемент 1158 * @param {CSSStyleDeclaration} computedStyle 1159 * @param {number} scrollBarWidth 1160 * @returns {{isFullscreenWidth: boolean, isFullscreenHeight: boolean, computedMarginNum: number}} 1162function t_scrollBarWidthCompensator__checkSize(computedStyle, scrollBarWidth) { 1163 var { innerWidth, innerHeight } = window; 1164 var computedWidth = computedStyle.getPropertyValue('width'); 1165 var computedWidthNum = parseFloat(computedWidth) || 0; 1166 var computedHeight = computedStyle.getPropertyValue('height'); 1167 var computedHeightNum = parseFloat(computedHeight) || 0; 1168 var computedMarginLeft = computedStyle.getPropertyValue('margin-left'); 1169 var computedMarginLeftNum = parseFloat(computedMarginLeft) || 0; 1170 var computedMarginRight = computedStyle.getPropertyValue('margin-right'); 1171 var computedMarginRightNum = parseFloat(computedMarginRight) || 0; 1172 var computedMarginNum = computedMarginLeftNum + computedMarginRightNum; 1174 var isFullscreenWidth = 1175 computedWidth === '100%' || 1176 computedWidth === '100vw' || 1177 computedWidthNum === innerWidth || 1178 computedWidthNum === innerWidth - scrollBarWidth || 1179 computedWidthNum === innerWidth - computedMarginNum || 1180 computedWidthNum === innerWidth - computedMarginNum - scrollBarWidth; 1181 var isFullscreenHeight = 1182 computedHeight === '100%' || 1183 computedHeight === '100vh' || 1184 computedHeight === 'auto' || 1185 computedHeightNum === innerHeight || 1186 computedHeightNum === innerHeight - scrollBarWidth; 1187 return { isFullscreenWidth, isFullscreenHeight, computedMarginNum }; 1191 * Отменяет компенсацию ширины полосы прокрутки, восстанавливает исходные стили `body` и фиксированных элементов. 1193function t_scrollBarWidthCompensator__cancel() { 1194 var obj = window.scrollBarWidthCompensator; 1195 if (!obj || !obj.isInited) return; 1196 obj.isInited = false; 1199 if (document.body.hasAttribute('data-tilda-initial-padding-right')) { 1200 document.body.style.paddingRight = document.body.getAttribute('data-tilda-initial-padding-right');