Show 'about mapcomplete' on index

This commit is contained in:
pietervdvn 2021-01-27 03:08:46 +01:00
parent 1831365597
commit 0fc8bbe1ed
3 changed files with 9 additions and 7 deletions

View file

@ -1,3 +1,5 @@
import {Utils} from "../Utils";
export class UIEventSource<T> { export class UIEventSource<T> {
public data: T; public data: T;
@ -6,7 +8,10 @@ export class UIEventSource<T> {
private static allSources : UIEventSource<any>[] = UIEventSource.PrepPerf(); private static allSources : UIEventSource<any>[] = UIEventSource.PrepPerf();
static PrepPerf(){ static PrepPerf() : UIEventSource<any>[]{
if(Utils.runningFromConsole){
return [];
}
// @ts-ignore // @ts-ignore
window.mcperf = () => { window.mcperf = () => {
console.log(UIEventSource.allSources.length, "uieventsources created"); console.log(UIEventSource.allSources.length, "uieventsources created");

View file

@ -28,9 +28,6 @@ export default class State {
// The singleton of the global state // The singleton of the global state
public static state: State; public static state: State;
public static runningFromConsole: boolean = false;
public readonly layoutToUse = new UIEventSource<LayoutConfig>(undefined); public readonly layoutToUse = new UIEventSource<LayoutConfig>(undefined);

View file

@ -118,10 +118,10 @@ if (layoutFromBase64.startsWith("wiki:")) {
} else { } else {
// We fall through: no theme loaded: just show a few buttons // We fall through: no theme loaded: just show a few buttons
State.state = new State(undefined); State.state = new State(undefined);
new Combine([new MoreScreen(true) new Combine([new MoreScreen(true),
.SetStyle("pointer-events: all;"), Translations.t.general.aboutMapcomplete
Translations.t.general.openStreetMapIntro
]).SetClass("block m-5 lg:w-3/4 lg:ml-40") ]).SetClass("block m-5 lg:w-3/4 lg:ml-40")
.SetStyle("pointer-events: all;")
.AttachTo("topleft-tools"); .AttachTo("topleft-tools");
} }
window.addEventListener('contextmenu', function (e) { // Not compatible with IE < 9 window.addEventListener('contextmenu', function (e) { // Not compatible with IE < 9