Gustavo Luigi 2024-01-11 16:46:54 -03:00
parent 69e1af0ba2
commit 4443c41b20
1 changed files with 22 additions and 18 deletions

View File

@ -188,6 +188,7 @@
let baseUrl = document.querySelector("meta[name=url-base]").getAttribute('content'); let baseUrl = document.querySelector("meta[name=url-base]").getAttribute('content');


let input = document.querySelector(".phone"); let input = document.querySelector(".phone");
if(input){
let iti = window.intlTelInput(input, { let iti = window.intlTelInput(input, {
initialCountry: "de", initialCountry: "de",
geoIpLookup: function(callback) { geoIpLookup: function(callback) {
@ -206,6 +207,7 @@
} }
return true; return true;
}); });
}
}); });
</script> </script>
<script> <script>
@ -214,6 +216,7 @@
let btnLoad = formLoad.querySelector('.btn-load'); let btnLoad = formLoad.querySelector('.btn-load');
let message = btnLoad.getAttribute('d-load-message'); let message = btnLoad.getAttribute('d-load-message');
btnLoad.disabled = true;
btnLoad.innerHTML = ` btnLoad.innerHTML = `
<span class="spinner-border spinner-border-sm" aria-hidden="true"></span> <span class="spinner-border spinner-border-sm" aria-hidden="true"></span>
<span role="status">${message}...</span> <span role="status">${message}...</span>
@ -262,7 +265,8 @@
const observer = new IntersectionObserver(entries => { const observer = new IntersectionObserver(entries => {
entries.forEach(entry => { entries.forEach(entry => {
if (entry.isIntersecting) { if (entry.isIntersecting) {
setTimeout(() => nameField.focus(), 2000); if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) nameField.focus()
else setTimeout(() => nameField.focus(), 2000);
observer.unobserve(targetElement); observer.unobserve(targetElement);
} }
}); });