clear liste etape scroll, set header position based on content or not, local storage for disable animation
This commit is contained in:
@@ -10,8 +10,10 @@ export async function initFirstLoadRouting(store, router, baseUrl, siteName) {
|
||||
window.localStorage.removeItem("decoupled_origin");
|
||||
document.title = store.pageTitle;
|
||||
setActiveNavItem(store.contentType, decoupled_origin.url);
|
||||
useLayoutStore().setHeaderPosition(false);
|
||||
} else {
|
||||
document.title = siteName;
|
||||
useLayoutStore().setHeaderPosition(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,9 +42,11 @@ export async function pageChange(href, store, siteName, mapStore, baseUrl) {
|
||||
store.resetStore(true);
|
||||
document.title = siteName;
|
||||
mapStore.resetMap();
|
||||
useLayoutStore().setHeaderPosition(true);
|
||||
} else {
|
||||
await store.fetchContentData(baseUrl + href);
|
||||
document.title = store.pageTitle;
|
||||
useLayoutStore().setHeaderPosition(false);
|
||||
}
|
||||
setActiveNavItem(store.contentType, href);
|
||||
|
||||
|
@@ -4,16 +4,30 @@ export function handleReactiveness() {
|
||||
const layoutStore = useLayoutStore();
|
||||
layoutStore.setupResizeListenner();
|
||||
|
||||
(function setupEtapeListeCollapse() {
|
||||
const listeToggleButton = document.querySelector('#retractable-message');
|
||||
|
||||
// toggle collapse and scroll for etape liste
|
||||
(function setEtapeListe() {
|
||||
const listeEtape = document.querySelector('#etapes-liste');
|
||||
const listeToggleButton = document.querySelector('#retractable-message');
|
||||
const column = document.querySelector('.layout__region--third');
|
||||
const header = document.querySelector('.layout-container > header');
|
||||
|
||||
const animationToggle = document.querySelector('#animation-toggle');
|
||||
|
||||
const EtapeListeScrollElements = {
|
||||
listeEtape,
|
||||
column,
|
||||
listeEtapeContent: listeEtape.querySelector('.item-list'),
|
||||
header,
|
||||
animationToggle: animationToggle.querySelector('.animation-toggle-container')
|
||||
}
|
||||
|
||||
layoutStore.shouldEtapeListeScroll(EtapeListeScrollElements);
|
||||
|
||||
if (!layoutStore.isDesktop) layoutStore.collapseEtapeListe(listeEtape, animationToggle);
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
layoutStore.shouldEtapeListeScroll(EtapeListeScrollElements);
|
||||
|
||||
if (layoutStore.isDesktop && layoutStore.isEtapeListRetracted) {
|
||||
layoutStore.expandEtapeListe(listeEtape, animationToggle);
|
||||
} else if (!layoutStore.isDesktop && !layoutStore.isEtapeListRetracted) {
|
||||
@@ -27,16 +41,11 @@ export function handleReactiveness() {
|
||||
layoutStore.collapseEtapeListe(listeEtape, animationToggle);
|
||||
} else {
|
||||
layoutStore.expandEtapeListe(listeEtape, animationToggle);
|
||||
layoutStore.shouldEtapeListeScroll(EtapeListeScrollElements);
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
layoutStore.checkIfEtapeListeShouldScroll();
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
layoutStore.checkIfEtapeListeShouldScroll();
|
||||
});
|
||||
}
|
||||
|
||||
export function setMenuToggle() {
|
||||
|
@@ -7,4 +7,5 @@ export function setupMapStore(mapStore, map, settings) {
|
||||
mapStore.defaultZoomDesktop = settings.settings.minZoom;
|
||||
mapStore.defaultZoomMobile = settings.settings.minZoom - 1;
|
||||
mapStore.map.flyTo([mapStore.defaultMapCenter.lat, mapStore.defaultMapCenter.lng], useLayoutStore().isDesktop ? mapStore.defaultZoomDesktop : mapStore.defaultZoomMobile);
|
||||
mapStore.checkReducedMotion();
|
||||
}
|
Reference in New Issue
Block a user