forked from MapComplete/MapComplete
Fix landscape mode
This commit is contained in:
parent
593ac5381a
commit
1b73f0a43a
9 changed files with 43 additions and 98 deletions
|
@ -10,9 +10,11 @@ export default class Ornament extends UIElement {
|
|||
constructor(index = undefined) {
|
||||
super();
|
||||
index = index ?? State.state.osmConnection.GetPreference("ornament");
|
||||
|
||||
this.SetClass("pt-3 pb-3 flex justify-center box-border")
|
||||
|
||||
this.ListenTo(index);
|
||||
this._index = index;
|
||||
this.SetClass("ornament")
|
||||
const self = this;
|
||||
this.onClick(() => {
|
||||
let c = Number(index.data);
|
||||
|
|
|
@ -17,8 +17,8 @@ export default class ScrollableFullScreen extends UIElement {
|
|||
}
|
||||
const returnToTheMap =
|
||||
new Combine([
|
||||
Svg.back_svg().SetClass("block sm:hidden"),
|
||||
Svg.close_svg().SetClass("hidden sm:block")
|
||||
Svg.back_svg().SetClass("block md:hidden"),
|
||||
Svg.close_svg().SetClass("hidden md:block")
|
||||
])
|
||||
.onClick(() => {
|
||||
ScrollableFullScreen.RestoreLeaflet();
|
||||
|
@ -31,19 +31,19 @@ export default class ScrollableFullScreen extends UIElement {
|
|||
|
||||
title.SetClass("block w-full text-2xl font-bold p-2 pl-4")
|
||||
const ornament = new Combine([new Ornament().SetStyle("height:5em;")])
|
||||
.SetClass("block sm:hidden h-5")
|
||||
.SetClass("md:hidden h-5")
|
||||
|
||||
|
||||
this._component =
|
||||
new Combine([
|
||||
new Combine([
|
||||
new Combine([returnToTheMap, title])
|
||||
.SetClass("border-b-2 border-black shadow sm:shadow-none bg-white p-2 pb-0 sm:p-0 flex overflow-x-hidden flex-shrink-0 max-h-20vh"),
|
||||
new Combine(["<span>", content, "</span>", ornament])
|
||||
.SetClass("block p-2 sm:pt-4 w-full h-screen landscape:h-screen sm:h-full sm:w-full overflow-y-auto overflow-x-hidden"),
|
||||
.SetClass("border-b-2 border-black shadow md:shadow-none bg-white p-2 pb-0 md:p-0 flex overflow-x-hidden flex-shrink-0 max-h-20vh"),
|
||||
new Combine([content, ornament])
|
||||
.SetClass("p-2 md:pt-4 w-full h-full overflow-y-auto overflow-x-hidden md:max-h-65vh"),
|
||||
// We add an ornament which takes around 5em. This is in order to make sure the Web UI doesn't hide
|
||||
]).SetClass("block flex flex-col relative bg-white")
|
||||
]).SetClass("fixed top-0 left-0 right-0 h-screen w-screen sm:max-h-65vh sm:w-auto sm:relative");
|
||||
]).SetClass("flex flex-col h-full relative bg-white")
|
||||
]).SetClass("fixed top-0 left-0 right-0 h-screen w-screen md:max-h-65vh md:w-auto md:relative");
|
||||
|
||||
this.dumbMode = false;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ export default class SearchAndGo extends UIElement {
|
|||
[bb[1], bb[3]]
|
||||
]
|
||||
State.state.selectedElement. setData(undefined);
|
||||
Hash.hash.setData(poi.osm_type+"_"+poi.osm_id);
|
||||
Hash.hash.setData(poi.osm_type+"/"+poi.osm_id);
|
||||
State.state.leafletMap.data.fitBounds(bounds);
|
||||
self._placeholder.setData(Translations.t.general.search.search);
|
||||
},
|
||||
|
|
|
@ -62,7 +62,6 @@ export default class FeatureInfoBox extends UIElement {
|
|||
}
|
||||
return new EditableTagRendering(tags, tr);
|
||||
});
|
||||
renderings[0]?.SetClass("first-rendering");
|
||||
if (!questionBoxIsUsed) {
|
||||
renderings.push(questionBox);
|
||||
}
|
||||
|
@ -72,7 +71,7 @@ export default class FeatureInfoBox extends UIElement {
|
|||
...renderings,
|
||||
tail.SetClass("featureinfobox-tail")
|
||||
]
|
||||
).SetClass("block sm:max-h-65vh")
|
||||
).SetClass("block")
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue