vers. 2.5.0
This commit is contained in:
57
js/app.js
Normal file → Executable file
57
js/app.js
Normal file → Executable file
@@ -980,8 +980,65 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
if (currentPage === 'page/contact') {
|
||||
setTimeout(() => initializeContactForm(), 100);
|
||||
}
|
||||
|
||||
if (currentPage === 'podcast') {
|
||||
// Reset visualizzazione podcast quando si cambia pagina e si torna
|
||||
if (typeof window.closePodcast === 'function') {
|
||||
window.closePodcast();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestione Podcast (Global Functions)
|
||||
*/
|
||||
window.openPodcast = function (url, title) {
|
||||
console.log('Apertura podcast:', title, url);
|
||||
const list = document.getElementById('podcast-list');
|
||||
const detail = document.getElementById('podcast-detail');
|
||||
const iframe = document.getElementById('podcast-iframe');
|
||||
const homeNav = document.getElementById('home-navigation');
|
||||
const scrollContainer = document.querySelector('main');
|
||||
|
||||
if (!list || !detail || !iframe) {
|
||||
console.error('Elementi podcast non trovati nel DOM');
|
||||
return;
|
||||
}
|
||||
|
||||
// Caricamento iframe
|
||||
iframe.src = url;
|
||||
|
||||
// Cambio vista
|
||||
list.style.display = 'none';
|
||||
detail.style.display = 'block';
|
||||
if (homeNav) homeNav.style.display = 'none';
|
||||
|
||||
// Scroll in alto
|
||||
if (scrollContainer) {
|
||||
scrollContainer.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
} else {
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
}
|
||||
};
|
||||
|
||||
window.closePodcast = function () {
|
||||
console.log('Chiusura podcast');
|
||||
const list = document.getElementById('podcast-list');
|
||||
const detail = document.getElementById('podcast-detail');
|
||||
const iframe = document.getElementById('podcast-iframe');
|
||||
const homeNav = document.getElementById('home-navigation');
|
||||
|
||||
if (!list || !detail || !iframe) return;
|
||||
|
||||
// Svuota iframe per fermare audio/video
|
||||
iframe.src = 'about:blank';
|
||||
|
||||
// Cambio vista
|
||||
list.style.display = 'block';
|
||||
detail.style.display = 'none';
|
||||
if (homeNav) homeNav.style.display = 'block';
|
||||
};
|
||||
|
||||
/**
|
||||
* Inizializzazione principale
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user