From f9c98d694149a671747f74f69742c721312aeed8 Mon Sep 17 00:00:00 2001 From: Valentin Date: Fri, 11 Oct 2024 11:51:02 +0200 Subject: [PATCH] essai de fix du pb de clic sur les liens statics --- web/themes/custom/caravane/assets/js/main.js | 10 ++++++---- web/themes/custom/caravane/assets/js/vuejs/Modale.vue | 7 ------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/web/themes/custom/caravane/assets/js/main.js b/web/themes/custom/caravane/assets/js/main.js index dfef359..d510e03 100644 --- a/web/themes/custom/caravane/assets/js/main.js +++ b/web/themes/custom/caravane/assets/js/main.js @@ -99,11 +99,13 @@ import router from './router/router'; function processStaticLinks(store, map) { let general_link_fields = document.querySelectorAll('#menu > ul > li > a'); - for (let field of general_link_fields) { - let general_link_href = field.getAttribute('href'); + for (let i =1; i < general_link_fields.length; i ++) { + let general_link_href = general_link_fields[i].getAttribute('href'); const nid = general_link_href.charAt(general_link_href.length-1); - field.setAttribute('data-node-nid', parseInt(nid)); - field.addEventListener('click', (e) => onClickContentLink(e, store, map, 'static')); + if (!isNaN(nid)) { + general_link_fields[i].setAttribute('data-node-nid', parseInt(nid)); + general_link_fields[i].addEventListener('click', (e) => onClickContentLink(e, store, map, 'static')); + } } } diff --git a/web/themes/custom/caravane/assets/js/vuejs/Modale.vue b/web/themes/custom/caravane/assets/js/vuejs/Modale.vue index eac815d..c97decb 100644 --- a/web/themes/custom/caravane/assets/js/vuejs/Modale.vue +++ b/web/themes/custom/caravane/assets/js/vuejs/Modale.vue @@ -138,14 +138,7 @@ const handleMapMovement = () => { watch( () => href.value, () => { - console.log("NEW HREF"); - console.log(href.value); - isModaleEtape = !isObjectEmpty(etape.value); - - console.log("CAS 1", !wasModaleEtape && isModaleEtape); - console.log("CAS 2", wasModaleEtape && isModaleEtape); - console.log("CAS 3", wasModaleEtape && !isModaleEtape); if (!wasModaleEtape && isModaleEtape) { document.documentElement.style.setProperty('--modale-enter-delay', `${duration.value}s`);