Small improvement to custom theme generator

This commit is contained in:
pietervdvn 2021-04-06 20:02:41 +02:00
parent 117c62e011
commit e1d7b256f9

View file

@ -21,14 +21,13 @@ import Constants from "../../Models/Constants";
export default class TagRenderingPanel extends InputElement<TagRenderingConfigJson> { export default class TagRenderingPanel extends InputElement<TagRenderingConfigJson> {
public IsImage = false;
public options: { title?: string; description?: string; disableQuestions?: boolean; isImage?: boolean; };
public readonly validText: UIElement;
IsSelected: UIEventSource<boolean> = new UIEventSource<boolean>(false);
private intro: UIElement; private intro: UIElement;
private settingsTable: UIElement; private settingsTable: UIElement;
public IsImage = false;
private readonly _value: UIEventSource<TagRenderingConfigJson>; private readonly _value: UIEventSource<TagRenderingConfigJson>;
public options: { title?: string; description?: string; disableQuestions?: boolean; isImage?: boolean; };
public readonly validText : UIElement;
constructor(languages: UIEventSource<string[]>, constructor(languages: UIEventSource<string[]>,
currentlySelected: UIEventSource<SingleSetting<any>>, currentlySelected: UIEventSource<SingleSetting<any>>,
@ -63,8 +62,18 @@ export default class TagRenderingPanel extends InputElement<TagRenderingConfigJs
} }
this._value.addCallback(value => { this._value.addCallback(value => {
let doPing = false;
if (value?.freeform?.key == "") { if (value?.freeform?.key == "") {
value.freeform = undefined; value.freeform = undefined;
doPing = true;
}
if (value?.render == "") {
value.render = undefined;
doPing = true;
}
if (doPing) {
this._value.ping(); this._value.ping();
} }
}) })
@ -138,8 +147,6 @@ export default class TagRenderingPanel extends InputElement<TagRenderingConfigJs
return this._value; return this._value;
} }
IsSelected: UIEventSource<boolean> = new UIEventSource<boolean>(false);
IsValid(t: TagRenderingConfigJson): boolean { IsValid(t: TagRenderingConfigJson): boolean {
return false; return false;
} }