champs url dans les icones de la map et suppr du data attribute nid sur les liens

This commit is contained in:
Valentin 2024-11-13 11:42:30 +01:00
parent c82fc633aa
commit f2680fc65a
5 changed files with 33 additions and 40 deletions

View File

@ -269,7 +269,7 @@ display:
popupAnchor:
x: ''
'y': ''
html: "<div></div>\r\n<div></div>\r\n<div></div>\r\n<div class=\"nid\">{{ nid }}</div>\r\n<div class=\"couleur\">{{ field_couleur }}</div>"
html: "<div></div>\r\n<div></div>\r\n<div></div>\r\n<div class=\"url\">[node:url]</div>\r\n<div class=\"couleur\">[node:field_couleur]</div>"
html_class: 'leaflet-map-divicon '
circle_marker_options: '{"radius":100,"color":"red","fillColor":"#f03","fillOpacity":0.5}'
leaflet_markercluster:

View File

@ -44,12 +44,13 @@ export const useLayoutStore = defineStore('layout', {
menuTitle.classList.toggle('open');
menuBurger.classList.toggle('open');
menuH2.classList.toggle('open');
if (this.isHamburgerMenuOpen) {
setTimeout(() => {
menuContainer.style.display = 'none';
setTimeout(() => {
// console.log('isHamburgerMenuOpen', this.isHamburgerMenuOpen);
if (this.isHamburgerMenuOpen) {
menuContainer.style.display = 'none';
}
this.isHamburgerMenuOpen = !this.isHamburgerMenuOpen;
}, 300);
}
}, 50);
document.addEventListener('click', (e) => {
if (!menuContainer.contains(e.target) && !menuBurger.contains(e.target)) {

View File

@ -26,15 +26,7 @@ function processEtapeLinks() {
function processStaticLinks() {
const general_link_fields = document.querySelectorAll('#menu > ul > li > a');
for (let i = 0; i < general_link_fields.length; i ++) {
let general_link_path = general_link_fields[i].getAttribute('data-drupal-link-system-path');
if (general_link_path && general_link_path !== '<front>') {
const match = [...general_link_path.match(/^node\/(\d+)$/)];
if (match) {
const nid = match[1];
general_link_fields[i].setAttribute('data-nid', parseInt(nid));
}
}
general_link_fields[i].addEventListener('click', (e) => e.preventDefault());
general_link_fields[i].addEventListener('click', (e) => e.preventDefault());
}
return general_link_fields;