Fix opening of various views when set by url-parameters, small styling tweaks in the popups

This commit is contained in:
Pieter Vander Vennet 2021-10-23 02:46:37 +02:00
parent d40bf15bc7
commit 933c0f0073
14 changed files with 237 additions and 248 deletions

View file

@ -26,12 +26,12 @@ export default class LeftControls extends Combine {
featureSwitchEnableExport: UIEventSource<boolean>,
featureSwitchExportAsPdf: UIEventSource<boolean>,
filteredLayers: UIEventSource<FilteredLayer[]>,
featureSwitchFilter: UIEventSource<boolean>,
selectedElement: UIEventSource<any>
featureSwitchFilter: UIEventSource<boolean>
},
guiState: {
downloadControlIsOpened: UIEventSource<boolean>,
filterViewIsOpened: UIEventSource<boolean>,
copyrightViewIsOpened: UIEventSource<boolean>
}) {
const toggledCopyright = new ScrollableFullScreen(
@ -41,7 +41,7 @@ export default class LeftControls extends Combine {
state.layoutToUse,
new ContributorCount(state).Contributors
),
undefined
guiState.copyrightViewIsOpened
);
const copyrightButton = new Toggle(
@ -49,8 +49,7 @@ export default class LeftControls extends Combine {
new MapControlButton(Svg.copyright_svg())
.onClick(() => toggledCopyright.isShown.setData(true)),
toggledCopyright.isShown
)
.SetClass("p-0.5");
).SetClass("p-0.5");
const toggledDownload = new Toggle(
new AllDownloads(
@ -73,11 +72,10 @@ export default class LeftControls extends Combine {
() => Translations.t.general.layerSelection.title.Clone(),
() =>
new FilterView(state.filteredLayers, state.overlayToggles).SetClass(
"block p-1 rounded-full"
"block p-1"
),
undefined,
guiState.filterViewIsOpened
),
).SetClass("rounded-lg"),
new MapControlButton(Svg.filter_svg())
.onClick(() => guiState.filterViewIsOpened.setData(true)),
guiState.filterViewIsOpened
@ -90,18 +88,6 @@ export default class LeftControls extends Combine {
);
state.locationControl.addCallback(() => {
// Close the layer selection when the map is moved
toggledDownload.isEnabled.setData(false);
copyrightButton.isEnabled.setData(false);
toggledFilter.isEnabled.setData(false);
});
state.selectedElement.addCallbackAndRunD((_) => {
toggledDownload.isEnabled.setData(false);
copyrightButton.isEnabled.setData(false);
toggledFilter.isEnabled.setData(false);
});
super([filterButton,
downloadButtonn,
copyrightButton])