Files
dragonroll/frontend/app/components/windows/MapViewerWindow.vue
2026-10-14 12:35:05 +00:00

34 lines
994 B
Vue

<script setup>
import { onMounted, ref } from 'vue';
import { SetupHandle, SetSize, ResetPosition, Top } from '@/services/Windows';
import WindowHandle from './partials/WindowHandle.vue';
import MapViewerPane from '../viewer/map/MapViewerPane.vue';
const props = defineProps(['data']);
const id = props.data.id;
const handle = ref(null);
const wrapper = ref(null);
const map = props.data.map ? { ...props.data.map } : null;
onMounted(() => {
Top(wrapper);
SetupHandle(id, handle);
SetSize(id, {
width: Math.max(480, Math.min(1100, window.innerWidth - 24)),
height: Math.max(360, Math.min(760, window.innerHeight - 32))
});
ResetPosition(id, 'center');
});
</script>
<template>
<div class="window-wrapper viewer-window" :id="'window-wrapper-' + id" ref="wrapper">
<WindowHandle :window="id" ref="handle" />
<MapViewerPane :map="map" />
</div>
</template>
<style scoped>
.viewer-window { min-width: 320px; min-height: 0; }
</style>