diff --git a/Models/Constants.ts b/Models/Constants.ts index a7d326e..24d7f72 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -1,7 +1,7 @@ import { Utils } from "../Utils"; export default class Constants { - public static vNumber = "0.4.0"; + public static vNumber = "0.4.2"; // The user journey states thresholds when a new feature gets unlocked public static userJourney = { diff --git a/UI/Base/LazyElement.ts b/UI/Base/LazyElement.ts index c153d80..9796a6c 100644 --- a/UI/Base/LazyElement.ts +++ b/UI/Base/LazyElement.ts @@ -6,9 +6,11 @@ export default class LazyElement extends UIElement { private _content: UIElement = undefined; public Activate: () => void; + private _loadingContent: string; - constructor(content: (() => UIElement)) { + constructor(content: (() => UIElement), loadingContent = "Rendering...") { super(); + this._loadingContent = loadingContent; this.dumbMode = false; const self = this; this.Activate = () => { @@ -21,7 +23,7 @@ export default class LazyElement extends UIElement { InnerRender(): string { if (this._content === undefined) { - return "Rendering..."; + return this._loadingContent; } return this._content.InnerRender(); } diff --git a/UI/BigComponents/LayerControlPanel.ts b/UI/BigComponents/LayerControlPanel.ts index f52acc1..2330bee 100644 --- a/UI/BigComponents/LayerControlPanel.ts +++ b/UI/BigComponents/LayerControlPanel.ts @@ -5,10 +5,10 @@ import LayerSelection from "./LayerSelection"; import Combine from "../Base/Combine"; import Translations from "../i18n/Translations"; -export default class LayerControlPanel extends UIElement{ +export default class LayerControlPanel extends UIElement { private readonly _panel: UIElement; - - + + constructor() { super(); let layerControlPanel: UIElement = undefined; @@ -21,7 +21,8 @@ export default class LayerControlPanel extends UIElement{ if (State.state.filteredLayers.data.length > 1) { const layerSelection = new LayerSelection(); - layerSelection.onClick(() => { }); + layerSelection.onClick(() => { + }); layerControlPanel = new Combine([layerSelection, "
", layerControlPanel]); } @@ -32,14 +33,14 @@ export default class LayerControlPanel extends UIElement{ ]).SetClass("only-on-mobile") .onClick(() => State.state.fullScreenMessage.setData(undefined)); - - layerControlPanel = new Combine([layerControlPanel, backButton]); - + + layerControlPanel = new Combine([layerControlPanel , backButton]); + this._panel = layerControlPanel; } - + InnerRender(): string { return this._panel.Render(); } - + } \ No newline at end of file diff --git a/UI/ShowDataLayer.ts b/UI/ShowDataLayer.ts index ea0571e..0c9c39b 100644 --- a/UI/ShowDataLayer.ts +++ b/UI/ShowDataLayer.ts @@ -124,7 +124,8 @@ export default class ShowDataLayer { const tags = State.state.allElements.getEventSourceFor(feature); - const uiElement: LazyElement = new LazyElement(() => new FeatureInfoBox(tags, layer)); + const uiElement: LazyElement = new LazyElement(() => new FeatureInfoBox(tags, layer), + "
Rendering
"); popup.setContent(uiElement.Render()); popup.on('remove', () => { State.state.selectedElement.setData(undefined);