forked from MapComplete/MapComplete
Fix runaway link, small issues
This commit is contained in:
parent
7d02ed0af6
commit
65fc2c5de4
2 changed files with 3 additions and 10 deletions
|
@ -19,7 +19,7 @@ export default class ExtraLinkButton extends UIElement {
|
||||||
featureSwitchWelcomeMessage: UIEventSource<boolean>, locationControl: UIEventSource<Loc>
|
featureSwitchWelcomeMessage: UIEventSource<boolean>, locationControl: UIEventSource<Loc>
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(state: { featureSwitchWelcomeMessage: UIEventSource<boolean>, locationControl: UIEventSource<Loc>, layoutToUse: { id: string, title: Translations } },
|
constructor(state: { featureSwitchWelcomeMessage: UIEventSource<boolean>, locationControl: UIEventSource<Loc>, layoutToUse: { id: string, title: Translation } },
|
||||||
config: ExtraLinkConfig) {
|
config: ExtraLinkConfig) {
|
||||||
super();
|
super();
|
||||||
this.state = state;
|
this.state = state;
|
||||||
|
|
|
@ -25,7 +25,6 @@ import Combine from "./Base/Combine";
|
||||||
import AddNewMarker from "./BigComponents/AddNewMarker";
|
import AddNewMarker from "./BigComponents/AddNewMarker";
|
||||||
import FilteredLayer from "../Models/FilteredLayer";
|
import FilteredLayer from "../Models/FilteredLayer";
|
||||||
import ExtraLinkButton from "./BigComponents/ExtraLinkButton";
|
import ExtraLinkButton from "./BigComponents/ExtraLinkButton";
|
||||||
import {SubtleButton} from "./Base/SubtleButton";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -164,19 +163,13 @@ export default class DefaultGUI {
|
||||||
() => new UserBadge(state)
|
() => new UserBadge(state)
|
||||||
),
|
),
|
||||||
Toggle.If(state.featureSwitchExtraLinkEnabled,
|
Toggle.If(state.featureSwitchExtraLinkEnabled,
|
||||||
() => {
|
() => new ExtraLinkButton(state, state.layoutToUse.extraLink)
|
||||||
if (state.layoutToUse.extraLink.text === undefined) {
|
|
||||||
return Translations.t.general.screenToSmall
|
|
||||||
}
|
|
||||||
return new ExtraLinkButton(state, state.layoutToUse.extraLink);
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
]).SetClass("flex flex-col")
|
]).SetClass("flex flex-col")
|
||||||
.AttachTo("userbadge")
|
.AttachTo("userbadge")
|
||||||
|
|
||||||
const el = state.layoutToUse.extraLink
|
|
||||||
new Combine([
|
new Combine([
|
||||||
new ExtraLinkButton(state, {...state.layoutToUse.extraLink, newTab: true})
|
new ExtraLinkButton(state, {...state.layoutToUse.extraLink, newTab: true, requirements: new Set<"iframe" | "no-iframe" | "welcome-message" | "no-welcome-message">( ) })
|
||||||
]).SetClass("flex items-center justify-center normal-background h-full")
|
]).SetClass("flex items-center justify-center normal-background h-full")
|
||||||
.AttachTo("on-small-screen")
|
.AttachTo("on-small-screen")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue