Fix issue #15: Dragonroll Frontend: Map Viewer adjustmentes
This commit is contained in:
@@ -1,13 +1,30 @@
|
||||
<script setup>
|
||||
import NoteContainer from './NoteContainer.vue';
|
||||
import MapViewerPane from '../map/MapViewerPane.vue';
|
||||
|
||||
import { ActivePane, AnchoredMap, ClearAnchoredMap } from '~/services/Content.js';
|
||||
import { useCampaignService } from '~/services/Campaign.js';
|
||||
import { CreateWindow } from '~/services/Windows';
|
||||
|
||||
const { Campaign } = useCampaignService();
|
||||
|
||||
// Detaching gives the map back a floating window and shows the open notes again.
|
||||
function DetachMap() {
|
||||
const map = AnchoredMap.value;
|
||||
if (!map) return;
|
||||
ClearAnchoredMap();
|
||||
CreateWindow('map_viewer', { map, campaign: Campaign.value?._id ?? null });
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="content">
|
||||
<NoteContainer>
|
||||
<NoteContainer v-show="ActivePane !== 'map'">
|
||||
|
||||
</NoteContainer>
|
||||
</NoteContainer>
|
||||
<div v-if="AnchoredMap" v-show="ActivePane === 'map'" class="anchored-map">
|
||||
<MapViewerPane :map="AnchoredMap" anchored @detach="DetachMap"></MapViewerPane>
|
||||
</div>
|
||||
<!-- PowerMod -->
|
||||
</div>
|
||||
</template>
|
||||
@@ -21,4 +38,14 @@ import NoteContainer from './NoteContainer.vue';
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
/* Hidden with v-show so the open notes stay mounted while the anchored map is displayed. */
|
||||
.anchored-map {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 0;
|
||||
flex-grow: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user