Customisable Layers button title
This commit is contained in:
parent
387c92e3cb
commit
ace8555a09
@ -109,7 +109,8 @@
|
|||||||
contextMenuCopyLink: 'Copy link to here',
|
contextMenuCopyLink: 'Copy link to here',
|
||||||
contextMenuCenterHere: 'Center here',
|
contextMenuCenterHere: 'Center here',
|
||||||
toggleTitle: 'Click to toggle this section',
|
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',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -97,6 +97,7 @@ function buildMessagesConfig(response: any): LiveAtlasMessageConfig {
|
|||||||
contextMenuCenterHere: liveAtlasMessages.contextMenuCenterHere || '',
|
contextMenuCenterHere: liveAtlasMessages.contextMenuCenterHere || '',
|
||||||
toggleTitle: liveAtlasMessages.toggleTitle || '',
|
toggleTitle: liveAtlasMessages.toggleTitle || '',
|
||||||
mapTitle: liveAtlasMessages.mapTitle || '',
|
mapTitle: liveAtlasMessages.mapTitle || '',
|
||||||
|
layersTitle: liveAtlasMessages.layersTitle || '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
src/index.d.ts
vendored
1
src/index.d.ts
vendored
@ -58,6 +58,7 @@ interface LiveAtlasMessageConfig {
|
|||||||
contextMenuCenterHere: string;
|
contextMenuCenterHere: string;
|
||||||
toggleTitle: string;
|
toggleTitle: string;
|
||||||
mapTitle: string;
|
mapTitle: string;
|
||||||
|
layersTitle: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type LiveAtlasUIElement = 'layers' | 'chat' | 'players' | 'maps' | 'settings';
|
export type LiveAtlasUIElement = 'layers' | 'chat' | 'players' | 'maps' | 'settings';
|
||||||
|
@ -94,7 +94,7 @@ export class DynmapLayerControl extends Control.Layers {
|
|||||||
|
|
||||||
section.style.display = 'none';
|
section.style.display = 'none';
|
||||||
|
|
||||||
button.title = 'Layers';
|
button.title = store.state.messages.layersTitle;
|
||||||
button.setAttribute('aria-expanded', 'false');
|
button.setAttribute('aria-expanded', 'false');
|
||||||
button.innerHTML = `
|
button.innerHTML = `
|
||||||
<svg class="svg-icon" aria-hidden="true">
|
<svg class="svg-icon" aria-hidden="true">
|
||||||
@ -114,6 +114,8 @@ export class DynmapLayerControl extends Control.Layers {
|
|||||||
this.visible = store.state.ui.visibleElements.has('layers');
|
this.visible = store.state.ui.visibleElements.has('layers');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(store.state.messages, (newValue) => (button.title = newValue.layersTitle));//
|
||||||
|
|
||||||
this.visible = store.state.ui.visibleElements.has('layers');
|
this.visible = store.state.ui.visibleElements.has('layers');
|
||||||
|
|
||||||
if (this.visible) {
|
if (this.visible) {
|
||||||
|
@ -132,6 +132,7 @@ export const state: State = {
|
|||||||
contextMenuCenterHere: '',
|
contextMenuCenterHere: '',
|
||||||
toggleTitle: '',
|
toggleTitle: '',
|
||||||
mapTitle: '',
|
mapTitle: '',
|
||||||
|
layersTitle: '',
|
||||||
},
|
},
|
||||||
|
|
||||||
loggedIn: false,
|
loggedIn: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user