Move some UI to Stimulus + Lo Pozzo geojson

This commit is contained in:
2024-11-27 11:48:03 +01:00
parent 8ef3331b25
commit 211379b986
9 changed files with 107 additions and 64 deletions

View File

@@ -106,8 +106,6 @@ UI.openSiteModal = async function (data, selector) {
for (let tab of dataTabs) {
tab.innerHTML = '';
}
//tabs.classList.remove('is-hidden');
let siteSheet = new SiteSheet();
siteSheet.siteData = data;
@@ -161,12 +159,6 @@ UI.openSiteModal = async function (data, selector) {
});
modal.classList.add('is-active');
const closeBtn = modal.querySelector('.modal-close');
const modalBg = modal.querySelector('.modal-background');
const closeModal = () => modal.classList.remove('is-active');
// CLose modal when clicking either on the X button or on the background
closeBtn.addEventListener('click', () => closeModal());
modalBg.addEventListener('click', () => closeModal());
this.imageGallery('gallery-1', surveys);
this.imageGallery('gallery-2', photos);
@@ -199,13 +191,6 @@ UI.openNotConserModal = async function (data, selector) {
});
modal.classList.add('is-active');
const closeBtn = modal.querySelector('.modal-close');
const modalBg = modal.querySelector('.modal-background');
const closeModal = () => modal.classList.remove('is-active');
// CLose modal when clicking either on the X button or on the background
closeBtn.addEventListener('click', () => closeModal());
modalBg.addEventListener('click', () => closeModal());
}
/**
* @param {object} data The data retrieved from the DB to display as modal content
@@ -268,12 +253,6 @@ UI.openFindingModal = async function (data, selector) {
}
});
modal.classList.add('is-active');
const closeBtn = modal.querySelector('.modal-close');
const modalBg = modal.querySelector('.modal-background');
const closeModal = () => modal.classList.remove('is-active');
// CLose modal when clicking either on the X button or on the background
closeBtn.addEventListener('click', () => closeModal());
modalBg.addEventListener('click', () => closeModal());
}
/**
* @param {string} menuListSel Menu list selector
@@ -281,7 +260,6 @@ UI.openFindingModal = async function (data, selector) {
* @param {L.LayerGroup} sites
*/
UI.sitesMenu = function (menuListSel, map, sites) {
// Close menu if arrow button is clicked...
let markers = [];
map.eachLayer(layer => {