mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 23:27:09 +00:00
Update model and add invalidated cycle
This commit is contained in:
@@ -12,12 +12,14 @@ export class EnumNode extends AbstractNode<string> {
|
||||
}
|
||||
|
||||
updateModel(el: Element, path: Path, model: DataModel) {
|
||||
model.set(path, el.querySelector('select')?.value)
|
||||
}
|
||||
|
||||
render(path: Path, value: string, view: TreeView) {
|
||||
const id = view.register(el => (el as HTMLInputElement).value = value)
|
||||
return this.wrap(path, view, `<span>${path.last()}</span>
|
||||
<select value="${value}">
|
||||
${this.options.map(o => `<option>${o}</option>`)}
|
||||
<select data-id=${id}>
|
||||
${this.options.map(o => `<option value="${o}">${o}</option>`).join('')}
|
||||
</select>`)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user