Various bug fixes, add layer selection and background selection as parameter to the URL (fix #86, fix #84)

This commit is contained in:
Pieter Vander Vennet 2020-08-08 02:16:42 +02:00
parent e35c85fc55
commit 97a69ff903
14 changed files with 111 additions and 25 deletions

View file

@ -25,7 +25,7 @@ export class Utils {
}
static DoEvery(millis: number, f: (() => void)) {
if(State.runningFromConsole){
if (State.runningFromConsole) {
return;
}
window.setTimeout(
@ -36,6 +36,17 @@ export class Utils {
, millis)
}
public static NoNull<T>(array: T[]): T[] {
const ls: T[] = [];
for (const t of array) {
if (t === undefined || t === null) {
continue;
}
ls.push(t);
}
return ls;
}
public static CreateLanguagePicker(label: string | UIElement = "") {
return new DropDown(label, State.state.layoutToUse.data.supportedLanguages.map(lang => {