Small code fixes, fix #198

This commit is contained in:
pietervdvn 2021-01-27 02:58:11 +01:00
parent 1b73f0a43a
commit 1831365597
5 changed files with 7 additions and 10 deletions

View file

@ -40,7 +40,7 @@ export default class ScrollableFullScreen extends UIElement {
new Combine([returnToTheMap, title]) new Combine([returnToTheMap, title])
.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"), .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]) new Combine([content, ornament])
.SetClass("p-2 md:pt-4 w-full h-full overflow-y-auto overflow-x-hidden md:max-h-65vh"), .SetClass("block 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 // We add an ornament which takes around 5em. This is in order to make sure the Web UI doesn't hide
]).SetClass("flex flex-col h-full relative bg-white") ]).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"); ]).SetClass("fixed top-0 left-0 right-0 h-screen w-screen md:max-h-65vh md:w-auto md:relative");

View file

@ -48,7 +48,8 @@ export default class PersonalLayersPanel extends UIElement {
layout.title, layout.title,
"</b><br/>", "</b><br/>",
layout.shortDescription ?? "" layout.shortDescription ?? ""
]).SetStyle("background: #eee; display: block; padding: 0.5em; border-radius:0.5em; overflow:auto;") ]).SetClass("block p1 overflow-auto rounded")
.SetStyle("background: #eee;")
this.checkboxes.push(header); this.checkboxes.push(header);
for (const layer of layout.layers) { for (const layer of layout.layers) {

View file

@ -24,10 +24,8 @@ export default class CheckBoxes extends InputElement<number[]> {
IsValid(ts: number[]): boolean { IsValid(ts: number[]): boolean {
if (ts === undefined) { return ts !== undefined;
return false;
}
return true;
} }
GetValue(): UIEventSource<number[]> { GetValue(): UIEventSource<number[]> {
@ -48,7 +46,7 @@ export default class CheckBoxes extends InputElement<number[]> {
body += htmlElement; body += htmlElement;
} }
return `<form id='${this.id}'>${body}</form>`; return `<form id='${this.id}'>${body}</form>`;
} }

View file

@ -47,6 +47,7 @@ export class RadioButton<T> extends InputElement<T> {
self._selectedElementIndex.setData(i); self._selectedElementIndex.setData(i);
}) })
} }
this.dumbMode = false;
} }
@ -69,7 +70,6 @@ export class RadioButton<T> extends InputElement<T> {
} }
InnerRender(): string { InnerRender(): string {
let body = ""; let body = "";
for (let i = 0; i < this._elements.length; i++){ for (let i = 0; i < this._elements.length; i++){
const el = this._elements[i]; const el = this._elements[i];
@ -119,7 +119,6 @@ export class RadioButton<T> extends InputElement<T> {
} }
} }
const el = document.getElementById(this.id); const el = document.getElementById(this.id);
el.addEventListener("change", el.addEventListener("change",
function () { function () {

View file

@ -10,7 +10,6 @@ import MoreScreen from "./UI/BigComponents/MoreScreen";
import State from "./State"; import State from "./State";
import Combine from "./UI/Base/Combine"; import Combine from "./UI/Base/Combine";
import Translations from "./UI/i18n/Translations"; import Translations from "./UI/i18n/Translations";
import {UIElement} from "./UI/UIElement";
let defaultLayout = "" let defaultLayout = ""
// --------------------- Special actions based on the parameters ----------------- // --------------------- Special actions based on the parameters -----------------