Каталог файловtilda-scripts-3.0.js
701 });702 703 if (704 window.innerWidth < 480 ||705 (window.isMobile && document.documentElement.clientWidth < 480) ||706 (isInstagram && screen.width < 480)707 ) {708 t_onReady(function () {709 var customStyleElements = document.querySelectorAll('[data-customstyle="yes"]');710 var fieldElements = document.querySelectorAll('[field] span, [field] strong, [field] em, [field] a');711 712
История файла и сравнение версий
for (var i = 0; i < customStyleElements.length; i++) {
713 var element = customStyleElements[i]; 715 if (parseInt(getComputedStyle(element).fontSize.replace('px', '')) > 26) { 716 element.style.fontSize = null; 717 element.style.lineHeight = null; 721 for (var i = 0; i < fieldElements.length; i++) { 722 var element = fieldElements[i]; 724 if (parseInt(getComputedStyle(element).fontSize.replace('px', '')) > 26) { 725 element.style.fontSize = null; 731 window.addEventListener('orientationchange', function () { 732 setTimeout(function () { 738 window.addEventListener('load', setBreakWords); 739 window.addEventListener('orientationchange', function () { 740 setTimeout(function () { 745 window.innerWidth < 900 || 746 (window.isMobile && document.documentElement.clientWidth < 900) || 747 (isInstagram && screen.width < 900) 749 t_onReady(function () { 750 var customStyleElements = document.querySelectorAll('[data-customstyle="yes"]'); 751 var fieldElements = document.querySelectorAll('[field] span, [field] strong, [field] em, [field] a'); 753 for (var i = 0; i < customStyleElements.length; i++) { 754 var element = customStyleElements[i]; 756 if (parseInt(getComputedStyle(element).fontSize.replace('px', '')) > 30) { 757 element.style.fontSize = null; 758 element.style.lineHeight = null; 762 for (var i = 0; i < fieldElements.length; i++) { 763 var element = fieldElements[i]; 765 if (parseInt(getComputedStyle(element).fontSize.replace('px', '')) > 30) { 766 element.style.fontSize = null; 770 var elements = document.querySelectorAll( 772 '.t-text:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' + 773 '.t-name:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' + 774 '.t-title:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' + 775 '.t-descr:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' + 776 '.t-heading:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' + 777 '.t-text-impact:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' + 778 '.t-subtitle:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' + 779 '.t-uptitle:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"])' 782 for (var i = 0; i < elements.length; i++) { 783 var element = elements[i]; 784 var elementStyle = element.getAttribute('style'); 786 if (elementStyle && elementStyle.indexOf('font-size') > -1) { 787 if (parseInt(getComputedStyle(element).fontSize.replace('px', '')) > 30) { 788 if (element.getAttribute('data-auto-correct-font-size') === 'rem') { 789 // set adaptive font size for mobile devices 790 var newStyle = elementStyle 791 .replace(/font-size.*px;/gi, 'font-size: 1.6rem;') 792 .replace('line-height', 'lineheight'); 793 element.setAttribute('style', newStyle); 795 // reset font-size for all other elements 796 var newStyle = elementStyle 797 .replace('font-size', 'fontsize') 798 .replace('line-height', 'lineheight'); 799 element.setAttribute('style', newStyle);