EXPORT CONFIG ! fin du centre de ressource

This commit is contained in:
2025-04-02 01:06:39 +02:00
parent 7792005403
commit 7387ce7f50
9 changed files with 155 additions and 97 deletions

View File

@@ -62,7 +62,7 @@
:content="content"
:couleur="brandColor" />
<RelatedRessources
v-if="contentType === 'etape' && content.relatedRessources"
v-if="contentType === 'etape' && content.relatedRessources.length"
:relatedRessources="content.relatedRessources"
:couleur="content.couleur || brandColor" />
</main>
@@ -80,7 +80,7 @@
</template>
<script setup>
import { watch, onMounted } from 'vue';
import { watch, onMounted, nextTick } from 'vue';
import { storeToRefs } from 'pinia';
import { useContentStore } from '../stores/content';
@@ -104,7 +104,6 @@ import ModaleExergue from './components/parties/ModaleExergue.vue';
import ModaleVideos from './components/parties/ModaleVideos.vue';
import ModaleGallerie from './components/parties/ModaleGallerie.vue';
import ModaleDocument from './components/parties/ModaleDocument.vue';
import { getRelatedRessources } from '../utils/content/contentFetchUtils';
const store = useContentStore();
const mapState = useMapStore();
@@ -138,8 +137,9 @@ const handleMapMovement = () => {
() => loading.value,
() => {
if (!loading.value) {
console.log('loading done');
isModaleEtape = contentType.value === 'etape';
console.log(contentType.value);
// Define helper functions in variables
const disableModaleTransition = () => {
@@ -158,7 +158,6 @@ const handleMapMovement = () => {
};
if (animationsAreEnabled.value) {
if (isModaleEtape) {
if (!wasModaleEtape) {
// national -> détail
@@ -181,8 +180,10 @@ const handleMapMovement = () => {
}
} else {
if (isModaleEtape) {
// ? -> détail
zoomToContentPlace();
} else {
// ? -> national
mapState.resetMap();
}
disableModaleTransition();
@@ -196,12 +197,38 @@ const handleMapMovement = () => {
);
};
watch(() => contentType.value, () => {
if (contentType.value === '') {
handleMapLock(false);
} else {
handleMapLock(true);
}
});
const handleMapLock = (shoudLock) => {
const checkAndExecute = () => {
const leafletLayer = document.querySelector('.leaflet-layer');
if (leafletLayer) {
if (shoudLock) {
mapState.lockMap();
} else {
mapState.unlockMap();
}
} else {
setTimeout(checkAndExecute, 100);
}
}
checkAndExecute();
}
onMounted(() => {
console.log('modale mounted');
isModaleEtape = contentType.value === 'etape';
wasModaleEtape = isModaleEtape;
handleColorChange();
handleMapMovement();
nextTick(() => {
isModaleEtape = contentType.value === 'etape';
wasModaleEtape = isModaleEtape;
handleColorChange();
handleMapMovement();
});
});
</script>