Add option to disable map context menu
This commit is contained in:
parent
431f34e437
commit
eba601e7fe
@ -160,6 +160,9 @@
|
||||
|
||||
// Use more compact pre-2.0 player marker style
|
||||
compactPlayerMarkers: false,
|
||||
|
||||
// Disable the map right click menu
|
||||
disableContextMenu: false,
|
||||
},
|
||||
|
||||
// Config version. Do not modify.
|
||||
|
@ -31,7 +31,7 @@
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<MapContextMenu :leaflet="leaflet" v-if="leaflet"></MapContextMenu>
|
||||
<MapContextMenu v-if="contextMenuEnabled && leaflet" :leaflet="leaflet"></MapContextMenu>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@ -81,6 +81,7 @@ export default defineComponent({
|
||||
linkControlEnabled = computed(() => store.state.components.linkControl),
|
||||
chatBoxEnabled = computed(() => store.state.components.chatBox),
|
||||
loginEnabled = computed(() => store.state.components.login),
|
||||
contextMenuEnabled = computed(() => !store.state.ui.disableContextMenu),
|
||||
logoControls = computed(() => store.state.components.logoControls),
|
||||
|
||||
currentWorld = computed(() => store.state.currentWorld),
|
||||
@ -108,6 +109,7 @@ export default defineComponent({
|
||||
linkControlEnabled,
|
||||
chatBoxEnabled,
|
||||
loginEnabled,
|
||||
contextMenuEnabled,
|
||||
|
||||
logoControls,
|
||||
followTarget,
|
||||
|
1
src/index.d.ts
vendored
1
src/index.d.ts
vendored
@ -122,6 +122,7 @@ interface LiveAtlasUIConfig {
|
||||
playersAboveMarkers: boolean;
|
||||
playersSearch: boolean;
|
||||
compactPlayerMarkers: boolean;
|
||||
disableContextMenu: boolean;
|
||||
}
|
||||
|
||||
export type LiveAtlasUIElement = 'layers' | 'chat' | LiveAtlasSidebarSection;
|
||||
|
@ -129,6 +129,10 @@ export const mutations: MutationTree<State> & Mutations = {
|
||||
state.ui.compactPlayerMarkers = uiConfig.compactPlayerMarkers;
|
||||
}
|
||||
|
||||
if(typeof uiConfig.disableContextMenu === 'boolean') {
|
||||
state.ui.disableContextMenu = uiConfig.disableContextMenu;
|
||||
}
|
||||
|
||||
if(typeof uiConfig.playersSearch === 'boolean') {
|
||||
state.ui.playersSearch = uiConfig.playersSearch;
|
||||
}
|
||||
|
@ -84,6 +84,7 @@ export type State = {
|
||||
playersAboveMarkers: boolean;
|
||||
playersSearch: boolean;
|
||||
compactPlayerMarkers: boolean;
|
||||
disableContextMenu: boolean;
|
||||
|
||||
screenWidth: number;
|
||||
screenHeight: number;
|
||||
@ -222,6 +223,7 @@ export const state: State = {
|
||||
playersAboveMarkers: true,
|
||||
playersSearch: true,
|
||||
compactPlayerMarkers: false,
|
||||
disableContextMenu: false,
|
||||
|
||||
screenWidth: window.innerWidth,
|
||||
screenHeight: window.innerHeight,
|
||||
|
Loading…
Reference in New Issue
Block a user