Merge develop

This commit is contained in:
Pieter Vander Vennet 2021-07-03 21:28:24 +02:00
commit 32e30e4b01
14 changed files with 90 additions and 131 deletions

View file

@ -65,8 +65,8 @@ export default class AttributionPanel extends Combine {
...Utils.NoNull(Array.from(layoutToUse.data.ExtractImages()))
.map(AttributionPanel.IconAttribution)
]);
this.SetClass("flex flex-col link-underline")
this.SetStyle("max-width: calc(100vw - 5em); width: 40em;")
this.SetClass("flex flex-col link-underline overflow-hidden")
this.SetStyle("max-width: calc(100vw - 5em); width: 40rem;")
}
private static CodeContributors(): BaseUIElement {
@ -105,7 +105,7 @@ export default class AttributionPanel extends Combine {
const sources = Utils.NoNull(Utils.NoEmpty(license.sources))
return new Combine([
`<img src='${iconPath}' style="width: 50px; height: 50px; margin-right: 0.5em;">`,
`<img src='${iconPath}' style="width: 50px; height: 50px; min-width: 50px; min-height: 50px; margin-right: 0.5em;">`,
new Combine([
new FixedUiElement(license.authors.join("; ")).SetClass("font-bold"),
new Combine([license.license,
@ -120,9 +120,10 @@ export default class AttributionPanel extends Combine {
return new Link(sourceLinkContent, lnk, true);
})
]
).SetClass("block")
]).SetClass("flex flex-col")
]).SetClass("flex")
).SetClass("block m-2")
]).SetClass("flex flex-col").SetStyle("width: calc(100% - 50px - 0.5em); min-width: 12rem;")
]).SetClass("flex flex-wrap border-b border-gray-300 m-2 border-box")
}
private static GenerateLicenses() {

View file

@ -26,12 +26,6 @@ export class Basemap {
attributionControl: extraAttribution !== undefined
});
L.control.scale(
{
position: 'topright',
}
).addTo(this.map)
// Users are not allowed to zoom to the 'copies' on the left and the right, stuff goes wrong then
// We give a bit of leeway for people on the edges

View file

@ -1,6 +1,3 @@
/**
* Handles and updates the user badge
*/
import {VariableUiElement} from "../Base/VariableUIElement";
import Svg from "../../Svg";
import State from "../../State";
@ -21,7 +18,7 @@ export default class UserBadge extends Toggle {
const loginButton = Translations.t.general.loginWithOpenStreetMap
.Clone()
.SetClass("userbadge-login pt-3 w-full")
.SetClass("userbadge-login pt-3 w-full h-full")
.onClick(() => State.state.osmConnection.AttemptLogin());
@ -32,7 +29,7 @@ export default class UserBadge extends Toggle {
});
const userBadge = userDetails.map(user => {
const userBadge = new VariableUiElement(userDetails.map(user => {
{
const homeButton = new VariableUiElement(
userDetails.map((userinfo) => {
@ -78,7 +75,7 @@ export default class UserBadge extends Toggle {
let dryrun = new FixedUiElement("");
if (user.dryRun) {
dryrun = new FixedUiElement("TESTING").SetClass("alert");
dryrun = new FixedUiElement("TESTING").SetClass("alert font-xs p-0 max-h-4");
}
const settings =
@ -87,15 +84,6 @@ export default class UserBadge extends Toggle {
true)
const userIcon = new Link(
user.img === undefined ? Svg.osm_logo_ui() : new Img(user.img)
.SetClass("rounded-full opacity-0 m-0 p-0 duration-500 w-16 h16 float-left")
,
`${user.backend}/user/${encodeURIComponent(user.name)}`,
true
);
const userName = new Link(
new FixedUiElement(user.name),
`${user.backend}/user/${user.name}`,
@ -113,24 +101,40 @@ export default class UserBadge extends Toggle {
.SetClass("userstats")
const usertext = new Combine([
userName,
dryrun,
new Combine([userName, dryrun]).SetClass("flex justify-end w-full"),
userStats
]).SetClass("usertext")
]).SetClass("flex flex-col sm:w-auto sm:pl-2 overflow-hidden w-0")
const userIcon =
(user.img === undefined ? Svg.osm_logo_ui() : new Img(user.img)).SetClass("rounded-full opacity-0 m-0 p-0 duration-500 w-16 min-width-16 h16 float-left")
.onClick(() => {
if(usertext.HasClass("w-0")){
usertext.RemoveClass("w-0")
usertext.SetClass("w-min pl-2")
}else{
usertext.RemoveClass("w-min")
usertext.RemoveClass("pl-2")
usertext.SetClass("w-0")
}
})
return new Combine([
userIcon,
usertext,
]).SetClass("h-16")
userIcon,
]).SetClass("h-16 flex bg-white")
}
});
}));
userBadge.SetClass("inline-block m-0 w-full").SetStyle("pointer-events: all")
super(
new VariableUiElement(userBadge),
userBadge,
loginButton,
State.state.osmConnection.isLoggedIn
)
this.SetClass("shadow rounded-full h-min overflow-hidden block w-max")
}