correction popup étape map
This commit is contained in:
@@ -6,16 +6,34 @@
|
||||
:zoom-amount="2.5"
|
||||
alt="Carte sensible du territoire"
|
||||
hover-message="Survolez pour zoomer dans la carte"
|
||||
@regular-loaded="setVerticalImages()"
|
||||
/>
|
||||
<figcaption class="caption">{{ partie.carteSensible.alt }}</figcaption>
|
||||
</figure>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { nextTick, onMounted } from 'vue';
|
||||
import { VueImageZoomer } from 'vue-image-zoomer';
|
||||
import 'vue-image-zoomer/dist/style.css';
|
||||
|
||||
const props = defineProps({
|
||||
partie: Object
|
||||
});
|
||||
|
||||
function setVerticalImages() {
|
||||
const zoomer = document.querySelector('.sensible-map');
|
||||
setTimeout(() => {
|
||||
if (zoomer.offsetWidth / zoomer.offsetHeight < 1) {
|
||||
zoomer.style.padding = '0 7vw';
|
||||
const caption = zoomer.querySelector('figcaption');
|
||||
caption.style.marginLeft = 0;
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const zoomer = document.querySelector('.sensible-map');
|
||||
// console.log('mounted');
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user