3101inputWrapper.classList.add(inputsboxHiddenClassName);3102}31033104if (windowHeight > documentHeight && tildaLabel) {3105setTimeout(function () {3106t_fadeOut(tildaLabel);3107}, 300);3108}3109} else {3110for (var i = 0; i < arrNotScroll.length; i++) {3111if (arrNotScroll[i] == recType) {3112isScroll = false;
break; } } if (isScroll) t_forms__scrollBeginForm(target); setTimeout(function () { if (!isNewSuccessBox) { inputWrapper.classList.add(inputsboxHiddenClassName); } }, 400); } const successUrl = form.getAttribute('data-success-url'); if (successUrl) { t_forms__handleRedirect(form, successUrl, successBox); } // Hide prev btn in step to step form if (recType == 835 || recType == 862) { var prevBtn = rec.querySelector('.t' + recType + '__btn_prev'); var quizWrapper = rec.querySelector('.t' + recType + '__wrapper'); var quizFormWrapper = rec.querySelector('.t' + recType + '__quiz-form-wrapper'); if (prevBtn) prevBtn.style.display = 'none'; if (quizWrapper) quizWrapper.style.minHeight = ''; if (quizFormWrapper) quizFormWrapper.style.minHeight = ''; }}function t_forms__handleRedirect(form, successUrl, successBox) { let timeout = 500; if (!t_forms__isNewSuccessBox(form)) { setTimeout(function () { window.location.href = successUrl; }, timeout); } else { const title = successBox?.getAttribute('data-success-title') || ''; const text = successBox?.getAttribute('data-success-message') || ''; const isPopupShowing = Boolean(title || text); const countdownElement = document.getElementById('tildaformsuccesspopupinfodigit-new'); if (isPopupShowing) { timeout = 5000; startRedirectCountdown(timeout); } // при нажатии на Continue подменяем обычный переход по ссылке // на перезагрузку страницы для одинаковой логики let linkButton = document.getElementById('tildaformsuccesspopuplink-new'); if (linkButton) { linkButton.removeEventListener('click', handleRedirectClick); linkButton.addEventListener('click', handleRedirectClick); } let mainTimeout = null; let redirectTimeout = null; mainTimeout = setTimeout(() => { try { const currentUrl = window.location.href; redirect(successUrl); // редирект без отображения попапа if (!isPopupShowing) { window.tildaForm.handleClosePopup(); // если через 2с не произошёл редирект, // показываем попап с кнопкой Continue redirectTimeout = setTimeout(() => { try { if (window.location.href === currentUrl) { handleRedirectError(); } } catch (error) { console.error(error); } }, 2000); } } catch (error) { console.error(error); } }, timeout); window.addEventListener('pageshow', () => { clearTimeout(mainTimeout);