forked from MapComplete/MapComplete
More styling tweaks
This commit is contained in:
parent
9a412c6b74
commit
77ffdc093a
8 changed files with 85 additions and 58 deletions
|
@ -3,6 +3,8 @@ import State from "../../State";
|
|||
import BackgroundSelector from "./BackgroundSelector";
|
||||
import LayerSelection from "./LayerSelection";
|
||||
import Combine from "../Base/Combine";
|
||||
import {FixedUiElement} from "../Base/FixedUiElement";
|
||||
import ScrollableFullScreen from "../Base/ScrollableFullScreen";
|
||||
import Translations from "../i18n/Translations";
|
||||
|
||||
export default class LayerControlPanel extends UIElement {
|
||||
|
@ -11,7 +13,7 @@ export default class LayerControlPanel extends UIElement {
|
|||
|
||||
constructor() {
|
||||
super();
|
||||
let layerControlPanel: UIElement = undefined;
|
||||
let layerControlPanel: UIElement = new FixedUiElement("");
|
||||
if (State.state.layoutToUse.data.enableBackgroundLayerSelection) {
|
||||
layerControlPanel = new BackgroundSelector();
|
||||
layerControlPanel.SetStyle("margin:1em");
|
||||
|
@ -27,16 +29,9 @@ export default class LayerControlPanel extends UIElement {
|
|||
}
|
||||
|
||||
|
||||
const backButton = new Combine([
|
||||
new Combine([Translations.t.general.returnToTheMap.Clone().SetClass("to-the-map")])
|
||||
.SetClass("to-the-map-inner")
|
||||
const title =Translations.t.general.layerSelection.title.SetClass("featureinfobox-title")
|
||||
|
||||
]).SetClass("only-on-mobile")
|
||||
.onClick(() => State.state.fullScreenMessage.setData(undefined));
|
||||
|
||||
layerControlPanel = new Combine([layerControlPanel , backButton]);
|
||||
|
||||
this._panel = layerControlPanel;
|
||||
this._panel = new ScrollableFullScreen(title, layerControlPanel);
|
||||
}
|
||||
|
||||
InnerRender(): string {
|
||||
|
|
|
@ -36,14 +36,14 @@ export default class LayerSelection extends UIElement {
|
|||
|
||||
const zoomStatus = new VariableUiElement(State.state.locationControl.map(location => {
|
||||
if (location.zoom < layer.layerDef.minzoom) {
|
||||
return Translations.t.general.zoomInToSeeThisLayer
|
||||
return Translations.t.general.layerSelection.zoomInToSeeThisLayer
|
||||
.SetClass("alert")
|
||||
.SetStyle("display: block ruby;width:min-content;")
|
||||
.Render();
|
||||
}
|
||||
return ""
|
||||
}))
|
||||
const style = "display:flex;align-items:center;"
|
||||
const style = "display:flex;align-items:center;flex-wrap:wrap;"
|
||||
this._checkboxes.push(new CheckBox(
|
||||
new Combine([icon, name, zoomStatus]).SetStyle(style),
|
||||
new Combine([iconUnselected, "<del>", name, "</del>", zoomStatus]).SetStyle(style),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue