Fixes to the personal theme

This commit is contained in:
Pieter Vander Vennet 2020-09-15 02:29:31 +02:00
parent ce1568f2bb
commit 9e6460030b
11 changed files with 126 additions and 102 deletions

View file

@ -12,15 +12,23 @@ export default class MultiLingualTextFields extends InputElement<any> {
value: UIEventSource<Map<string, UIEventSource<string>>> = undefined) {
super(undefined);
this._value = value ?? new UIEventSource({});
const self = this;
this._value.addCallbackAndRun(latestData => {
if(typeof(latestData) === "string"){
console.warn("Refusing string for multilingual input",latestData);
self._value.setData({});
}
})
const self = this;
function setup(languages: string[]) {
if(languages === undefined){
if (languages === undefined) {
return;
}
const newFields = new Map<string, TextField<string>>();
for (const language of languages) {
if(language.length != 2){
if (language.length != 2) {
continue;
}