retour à l'index en cliquant sur la carte depuis une étape
This commit is contained in:
@@ -23,11 +23,9 @@ export function handleClickableElements(clickableElements, store, router, baseUr
|
||||
if (href.startsWith(baseUrl)) href = href.replace(baseUrl, '');
|
||||
|
||||
link.onclick = async function (e) {
|
||||
console.log('click on link, route push');
|
||||
|
||||
router.push(href);
|
||||
if (href !== window.location.pathname) {
|
||||
pageChange(href, store, siteName, mapStore, baseUrl);
|
||||
router.push(href);
|
||||
pageChange(href, store, siteName, mapStore, baseUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,7 +38,6 @@ export async function handleBrowserNavigation(store, baseUrl, siteName, mapStore
|
||||
}
|
||||
|
||||
export async function pageChange(href, store, siteName, mapStore, baseUrl) {
|
||||
console.log('trigger page change');
|
||||
if (href === '/') {
|
||||
store.resetStore(true);
|
||||
document.title = siteName;
|
||||
|
@@ -4,6 +4,7 @@ export function processClickableElements() {
|
||||
generalListLinks: processStaticLinks(),
|
||||
logoLink: processLogoLink(),
|
||||
mapIcons: processMapIcons(),
|
||||
mapContainer: processMapContainer(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -64,3 +65,11 @@ function processMapIcons() {
|
||||
|
||||
return icons;
|
||||
}
|
||||
|
||||
function processMapContainer() {
|
||||
let mapContainer = document.querySelector('.leaflet-layer');
|
||||
mapContainer.style.height = "100vh";
|
||||
mapContainer.style.width = "100vw";
|
||||
mapContainer.dataset.href = "/";
|
||||
return mapContainer;
|
||||
}
|
Reference in New Issue
Block a user