Add return to map button on layer panel

This commit is contained in:
pietervdvn 2021-01-07 15:19:50 +01:00
parent 8e55799c4f
commit 7dc7cc283d
4 changed files with 20 additions and 6 deletions

10
Svg.ts

File diff suppressed because one or more lines are too long

View file

@ -3,6 +3,7 @@ import State from "../../State";
import BackgroundSelector from "./BackgroundSelector";
import LayerSelection from "./LayerSelection";
import Combine from "../Base/Combine";
import Translations from "../i18n/Translations";
export default class LayerControlPanel extends UIElement{
private readonly _panel: UIElement;
@ -23,6 +24,17 @@ export default class LayerControlPanel extends UIElement{
layerSelection.onClick(() => { });
layerControlPanel = new Combine([layerSelection, "<br/>", layerControlPanel]);
}
const backButton = new Combine([
new Combine([Translations.t.general.returnToTheMap.Clone().SetClass("to-the-map")])
.SetClass("to-the-map-inner")
]).SetClass("only-on-mobile")
.onClick(() => State.state.fullScreenMessage.setData(undefined));
layerControlPanel = new Combine([layerControlPanel, backButton]);
this._panel = layerControlPanel;
}

View file

@ -7,6 +7,9 @@ import Combine from "../Base/Combine";
import {FixedUiElement} from "../Base/FixedUiElement";
import Translations from "../i18n/Translations";
/**
* Shows the panel with all layers and a toggle for each of them
*/
export default class LayerSelection extends UIElement {
private readonly _checkboxes: UIElement[];

View file

@ -35,7 +35,6 @@
font-weight: bold;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
flex-grow: 2;
word-break: break-all;
}