rerefactor du fetching de contenus une mielleure ux au load des modales (description dans le readme)

This commit is contained in:
2025-06-26 15:26:18 +02:00
parent e85851bd4d
commit f44fbd8d06
21 changed files with 465 additions and 367 deletions

View File

@@ -1,6 +1,6 @@
import { initVueContentModale } from './utils/vue-setup';
import { processClickableElements } from './utils/process-clickable-elements';
import { handleReactiveness, setMenuToggle, setHamburgerWhenLogged } from './utils/layout-setup';
import { handleReactiveness, setMenuToggle, setRightSectionsWhenLogged } from './utils/layout-setup';
import { initFirstLoadRouting, handleClickableElements, handleBrowserNavigation } from './utils/handle-navigation';
import { setupMapStore, preloadEtapesTiles } from './utils/map-setup';
@@ -13,16 +13,15 @@ import '../scss/main.scss'
(function ($, Drupal, drupalSettings) {
const CaravaneTheme = function () {
function init () {
console.log('07/04 ci-cd fonctionne, import des configs ?')
// console.log('DrupalSettings', drupalSettings);
const baseUrl = window.location.protocol + "//" + window.location.host;
const siteName = document.querySelector('#site_name').innerText;
const { store, mapStore, router, route } = initVueContentModale();
const router = initVueContentModale();
handleReactiveness();
setMenuToggle();
setHamburgerWhenLogged(drupalSettings);
setRightSectionsWhenLogged(drupalSettings);
// https://www.drupal.org/docs/extending-drupal/contributed-modules/contributed-module-documentation/leaflet/leaflet-api
@@ -44,22 +43,21 @@ import '../scss/main.scss'
} = processClickableElements();
const clickableElements = [...etapeListLinks, ...generalListLinks, logoLink, ...mapIcons, mapContainer];
setupMapStore(mapStore, map, settings);
setupMapStore(map, settings);
// preloadEtapesTiles(mapStore, map);
// preloadEtapesTiles(map);
initFirstLoadRouting(store, router, baseUrl, siteName);
initFirstLoadRouting(router, baseUrl, siteName);
handleClickableElements(clickableElements, store, router, baseUrl, siteName, mapStore);
handleClickableElements(clickableElements, router, baseUrl, siteName);
window.addEventListener("popstate", () => {
handleBrowserNavigation(store, baseUrl, siteName, mapStore);
handleBrowserNavigation(baseUrl, siteName);
});
});
}
}
}
init()
}
CaravaneTheme()