if (document.body.scrollHeight > window.innerHeight) {
1814 document.body.style.paddingRight = 1815 Math.abs(window.innerWidth - document.documentElement.clientWidth) + 'px'; 1816 document.body.style.overflowY = 'hidden'; 1818 clearInterval(timerId); 1822 // clearTimeout(timer); 1826function tma__debounce(func, wait, immediate) { 1829 return function () { 1831 var args = arguments; 1832 var later = function () { 1834 if (!immediate) func.apply(context, args); 1836 var callNow = immediate && !timeout; 1838 clearTimeout(timeout); 1839 timeout = setTimeout(later, wait); 1841 if (callNow) func.apply(context, args); 1845function tma__hideText(text) { 1846 var arrText = text.split('@'); 1848 if (arrText.length !== 2) return text; 1850 var textName = arrText[0].substring(0, 3); 1851 var domainZone = arrText[1].split('.').pop(); 1853 return textName + '***@***.' + domainZone; 1857 * @typedef TTooltipParams 1858 * @property {Element} element - Элемент, на котором будет отображен тултип 1859 * @property {string} [text] - Текст тултипа. По умолчанию текст берется из атрибута data-tilda-tooltip 1860 * @property {string} [tooltipClass] - Класс, который будет добавлен элементу тултипа 1861 * @property {'top' | 'bottom' | 'left' | 'right'} [position] - Позиция тултипа относительно элемента. По умолчанию 'right' 1862 * @property {number} [gap] - Расстояние между элементом и тултипом 1863 * @property {number} [maxWidth] - Максимальная ширина тултипа 1864 * @property {number} [timeout] - Задержка перед показом тултипа 1865 * @property {number} [zIndex = 1000] - z-index тултипа 1866 * @property {HTMLElement} [insertElement] - Элемент, в который будет вставлен тултип. По умолчанию тултип вставляется в body 1871 * @param {TTooltipParams} settings - настройки 1873function tma__drawTooltip(settings) { 1874 var element = settings.element; 1875 if (!element) return; 1877 /** @type {Partial<TTooltipParams>} */ 1879 text: element.getAttribute('data-tooltip-text') || '', 1886 insertElement: document.body, 1888 var options = Object.assign(defaults, settings); 1892 function tma__onMouseEnterTooltipHandler() { 1893 timeoutId = setTimeout(function () { 1894 var tooltipHtml = tma__getTooltipHtml(options.text, options.tooltipClass); 1895 var container = document.body; 1897 if (options.insertElement) container = options.insertElement; 1899 container.insertAdjacentHTML('beforeend', tooltipHtml);