champs url dans les icones de la map et suppr du data attribute nid sur les liens
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export function processClickableElements() {
|
||||
return {
|
||||
return {
|
||||
etapeListLinks: processEtapeLinks(),
|
||||
generalListLinks: processStaticLinks(),
|
||||
logoLink: processLogoLink(),
|
||||
@@ -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;
|
||||
@@ -70,11 +62,11 @@ function processMapIcons() {
|
||||
const popup = document.querySelector('.leaflet-tooltip-center > div');
|
||||
popup.style.opacity = "1";
|
||||
});
|
||||
|
||||
|
||||
icon.addEventListener('mouseleave', () => {
|
||||
icon.style.transform = icon.style.transform.split(' ')[0] + icon.style.transform.split(' ')[1] + icon.style.transform.split(' ')[2];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return icons;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user