Fix back button; add title

This commit is contained in:
Pieter Vander Vennet 2021-01-08 18:02:07 +01:00
parent 6e77504854
commit 2f57010202
14 changed files with 115 additions and 43 deletions

View file

@ -41,6 +41,7 @@ import FeatureDuplicatorPerLayer from "./Logic/FeatureSource/FeatureDuplicatorPe
import LayerConfig from "./Customizations/JSON/LayerConfig";
import ShowDataLayer from "./UI/ShowDataLayer";
import Hash from "./Logic/Web/Hash";
import HistoryHandling from "./Logic/Actors/HistoryHandling";
export class InitUiElements {
@ -133,7 +134,6 @@ export class InitUiElements {
if (feature === undefined) {
State.state.fullScreenMessage.setData(undefined);
Hash.hash.setData(undefined);
}
if (feature?.properties === undefined) {
return;
@ -159,12 +159,18 @@ export class InitUiElements {
layer
);
State.state.fullScreenMessage.setData(featureBox);
State.state.fullScreenMessage.setData({
content: featureBox,
hashText: feature.properties.id.replace("/", "_"),
titleText: featureBox.title
});
break;
}
}
);
new HistoryHandling(Hash.hash, State.state.fullScreenMessage);
InitUiElements.OnlyIf(State.state.featureSwitchUserbadge, () => {
new UserBadge().AttachTo('userbadge');
});
@ -279,20 +285,20 @@ export class InitUiElements {
})
State.state.selectedElement.addCallback(selected => {
if(selected !== undefined){
if (selected !== undefined) {
checkbox.isEnabled.setData(false);
}
})
const fullOptions2 = new FullWelcomePaneWithTabs();
State.state.fullScreenMessage.setData(fullOptions2)
State.state.fullScreenMessage.setData({content: fullOptions2, hashText: "welcome"})
Svg.help_svg()
.SetClass("open-welcome-button")
.SetClass("shadow")
.onClick(() => {
State.state.fullScreenMessage.setData(fullOptions2)
State.state.fullScreenMessage.setData({content: fullOptions2, hashText: "welcome"})
}).AttachTo("help-button-mobile");
@ -326,7 +332,7 @@ export class InitUiElements {
const fullScreen = new LayerControlPanel();
checkbox.isEnabled.addCallback(isEnabled => {
if (isEnabled) {
State.state.fullScreenMessage.setData(fullScreen);
State.state.fullScreenMessage.setData({content: fullScreen, hashText: "layer-select"});
}
})
State.state.fullScreenMessage.addCallback(latest => {