Allow customisation of context menu text
This commit is contained in:
parent
4d34927c39
commit
6531040f9d
@ -106,6 +106,8 @@
|
||||
loadingTitle: 'Loading...',
|
||||
locationRegion: 'Region',
|
||||
locationChunk: 'Chunk',
|
||||
contextMenuCopyLink: 'Copy link to here',
|
||||
contextMenuCenterHere: 'Center here',
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -93,6 +93,8 @@ function buildMessagesConfig(response: any): LiveAtlasMessageConfig {
|
||||
loadingTitle: liveAtlasMessages.loadingTitle || '',
|
||||
locationRegion: liveAtlasMessages.locationRegion || '',
|
||||
locationChunk: liveAtlasMessages.locationChunk || '',
|
||||
contextMenuCopyLink: liveAtlasMessages.contextMenuCopyLink || '',
|
||||
contextMenuCenterHere: liveAtlasMessages.contextMenuCenterHere || '',
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,10 +2,14 @@
|
||||
<nav id="map__context-menu" v-show="menuVisible" ref="menuElement" :style="style">
|
||||
<ul class="menu">
|
||||
<li>
|
||||
<button ref="locationButton" type="button" v-clipboard="locationCopy">{{locationLabel}}</button>
|
||||
<button ref="locationButton" type="button" v-clipboard="locationCopy">{{ locationLabel }}</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" v-clipboard="url">{{ messageCopyLink }}</button>
|
||||
</li>
|
||||
<li>
|
||||
<button type="button" @click.prevent="pan">{{ messageCenterHere }}</button>
|
||||
</li>
|
||||
<li><button type="button" v-clipboard="url">Copy link to here</button></li>
|
||||
<li><button type="button" @click.prevent="pan">Center here</button></li>
|
||||
<WorldListItem v-if="currentWorld" :world="currentWorld"></WorldListItem>
|
||||
</ul>
|
||||
</nav>
|
||||
@ -32,7 +36,10 @@ export default defineComponent({
|
||||
|
||||
setup(props) {
|
||||
const store = useStore(),
|
||||
event = ref<LeafletMouseEvent|null>(null),
|
||||
event = ref<LeafletMouseEvent | null>(null),
|
||||
|
||||
messageCopyLink = computed(() => store.state.messages.contextMenuCopyLink),
|
||||
messageCenterHere = computed(() => store.state.messages.contextMenuCenterHere),
|
||||
|
||||
menuElement = ref<HTMLInputElement | null>(null),
|
||||
locationButton = ref<HTMLInputElement | null>(null),
|
||||
@ -130,6 +137,9 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
return {
|
||||
messageCopyLink,
|
||||
messageCenterHere,
|
||||
|
||||
menuVisible,
|
||||
menuElement,
|
||||
locationButton,
|
||||
|
2
src/index.d.ts
vendored
2
src/index.d.ts
vendored
@ -61,4 +61,6 @@ interface LiveAtlasMessageConfig {
|
||||
loadingTitle: string;
|
||||
locationRegion: string;
|
||||
locationChunk: string;
|
||||
contextMenuCopyLink: string;
|
||||
contextMenuCenterHere: string;
|
||||
}
|
@ -124,6 +124,8 @@ export const state: State = {
|
||||
loadingTitle: '',
|
||||
locationRegion: '',
|
||||
locationChunk: '',
|
||||
contextMenuCopyLink: '',
|
||||
contextMenuCenterHere: ''
|
||||
},
|
||||
|
||||
loggedIn: false,
|
||||
|
Loading…
Reference in New Issue
Block a user