From ace8555a092ff41cab3de3ae29d37da9e833d04b Mon Sep 17 00:00:00 2001 From: James Lyne Date: Fri, 28 May 2021 21:28:21 +0100 Subject: [PATCH] Customisable Layers button title --- index.html | 3 ++- src/api.ts | 1 + src/index.d.ts | 1 + src/leaflet/control/DynmapLayerControl.ts | 4 +++- src/store/state.ts | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 0156bac..97055d2 100644 --- a/index.html +++ b/index.html @@ -109,7 +109,8 @@ contextMenuCopyLink: 'Copy link to here', contextMenuCenterHere: 'Center here', toggleTitle: 'Click to toggle this section', - mapTitle: 'Map - Use the arrow keys to pan the map' + mapTitle: 'Map - Use the arrow keys to pan the map', + layersTitle: 'Layers', } }; diff --git a/src/api.ts b/src/api.ts index ce7c1a9..042773f 100644 --- a/src/api.ts +++ b/src/api.ts @@ -97,6 +97,7 @@ function buildMessagesConfig(response: any): LiveAtlasMessageConfig { contextMenuCenterHere: liveAtlasMessages.contextMenuCenterHere || '', toggleTitle: liveAtlasMessages.toggleTitle || '', mapTitle: liveAtlasMessages.mapTitle || '', + layersTitle: liveAtlasMessages.layersTitle || '', } } diff --git a/src/index.d.ts b/src/index.d.ts index 935c542..20a2377 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -58,6 +58,7 @@ interface LiveAtlasMessageConfig { contextMenuCenterHere: string; toggleTitle: string; mapTitle: string; + layersTitle: string; } export type LiveAtlasUIElement = 'layers' | 'chat' | 'players' | 'maps' | 'settings'; diff --git a/src/leaflet/control/DynmapLayerControl.ts b/src/leaflet/control/DynmapLayerControl.ts index 1bb996c..4b01e5a 100644 --- a/src/leaflet/control/DynmapLayerControl.ts +++ b/src/leaflet/control/DynmapLayerControl.ts @@ -94,7 +94,7 @@ export class DynmapLayerControl extends Control.Layers { section.style.display = 'none'; - button.title = 'Layers'; + button.title = store.state.messages.layersTitle; button.setAttribute('aria-expanded', 'false'); button.innerHTML = `