Templates
Caricamento...
'; box.appendChild(closeBtn); box.appendChild(contentDiv); modal.appendChild(box); document.body.appendChild(modal); /* Close on backdrop click */ modal.addEventListener('click', function(e) { if (e.target === modal) modal.style.display = 'none'; }); /* Close on Escape */ document.addEventListener('keydown', function(e) { if (e.key === 'Escape') modal.style.display = 'none'; }); var loaded = false; links.forEach(function(link) { link.addEventListener('click', function(e) { e.preventDefault(); modal.style.display = 'block'; document.body.style.overflow = 'hidden'; modal.addEventListener('transitionend', function() {}, {once:true}); if (!loaded) { fetch('/privacy-policy/') .then(function(r) { return r.text(); }) .then(function(html) { var parser = new DOMParser(); var doc = parser.parseFromString(html, 'text/html'); var entry = doc.querySelector('.entry-content, .page-content, article .content, main article'); contentDiv.innerHTML = entry ? entry.innerHTML : 'Errore nel caricamento della Privacy Policy. Aprila in una nuova scheda.
'; loaded = true; }) .catch(function() { contentDiv.innerHTML = 'Errore nel caricamento. Apri la Privacy Policy in una nuova scheda.
'; }); } }); }); /* Restore scroll on close */ var observer = new MutationObserver(function() { if (modal.style.display === 'none') document.body.style.overflow = ''; }); observer.observe(modal, {attributes: true, attributeFilter: ['style']}); });
Comments section !