Fix bugs with loading of themes
This commit is contained in:
parent
07e611bf10
commit
e0694fee9d
4 changed files with 12 additions and 6 deletions
|
@ -17,7 +17,6 @@ export class ElementStorage {
|
|||
|
||||
addElement(element): UIEventSource<any> {
|
||||
const eventSource = new UIEventSource<any>(element.properties);
|
||||
console.log("Creating a new tag storate for ", element.properties.id)
|
||||
this._elements[element.properties.id] = eventSource;
|
||||
return eventSource;
|
||||
}
|
||||
|
|
|
@ -41,9 +41,13 @@ export default class SavePanel extends UIElement {
|
|||
this.json = jsonTextField;
|
||||
this.loadFromJson = new SubtleButton("./assets/reload.svg", "<b>Load the JSON file below</b>")
|
||||
.onClick(() => {
|
||||
try{
|
||||
const json = jsonTextField.GetValue().data;
|
||||
const parsed : LayoutConfigJson = JSON.parse(json);
|
||||
config.setData(parsed);
|
||||
}catch(e){
|
||||
alert("Invalid JSON: "+e)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -43,6 +43,9 @@ export class RadioButton<T> extends InputElement<T> {
|
|||
self._selectedElementIndex.setData(i);
|
||||
}
|
||||
})
|
||||
elements[i].GetValue().addCallback(() => {
|
||||
self._selectedElementIndex.setData(i);
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -73,12 +73,12 @@ export class TextField extends InputElement<string> {
|
|||
label = this._label.Render();
|
||||
}
|
||||
return new Combine([
|
||||
`<div id="${this.id}">`,
|
||||
`<span id="${this.id}">`,
|
||||
`<form onSubmit='return false' class='form-text-field'>`,
|
||||
label,
|
||||
`<input type='${this._htmlType}' placeholder='${placeholder}' id='txt-${this.id}'/>`,
|
||||
`</form>`,
|
||||
`</div>`
|
||||
`</span>`
|
||||
]).Render();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue