Files
customerTicket/static/js/magic-link-confirmation.js
2026-10-06 10:03:22 +03:30

22 lines
898 B
JavaScript

const confirmationForm = document.querySelector('[data-magic-confirmation]');
if (confirmationForm) {
confirmationForm.addEventListener('submit', (event) => {
const button = confirmationForm.querySelector('button[type="submit"]');
if (button.disabled) {
event.preventDefault();
return;
}
button.disabled = true;
button.setAttribute('aria-busy', 'true');
button.textContent = 'در حال باز کردن تیکت…';
confirmationForm.querySelector('[role="status"]').textContent = button.textContent;
});
window.addEventListener('pageshow', () => {
const button = confirmationForm.querySelector('button[type="submit"]');
button.disabled = false;
button.removeAttribute('aria-busy');
button.textContent = 'خروج از حساب و مشاهده تیکت';
confirmationForm.querySelector('[role="status"]').textContent = '';
});
}