Revert "ui: tree: defer tree update when not mounted"

This reverts commit 97c31aca17.
This commit is contained in:
bordun 2020-12-10 11:17:05 +01:00
parent 79ce7e6bac
commit fe88a538be
2 changed files with 3 additions and 19 deletions

View file

@ -21,8 +21,7 @@ class UiTree extends UiWidget {
this.mounted = false
this.list = this.container.appendChild(html`<ol style="--depth: 1"></ol`)
this.dragDummy = html`<span></span>`
this.deferredUpdateTimeout = null
this.editor = options.editor
this.expanded = {}
@ -86,21 +85,6 @@ class UiTree extends UiWidget {
updateTree(selectedWidgets) {
if (this.parent.mounted) {
this.deferredUpdateTree(selectedWidgets)
} else {
clearTimeout(this.deferredUpdateTimeout)
this.deferredUpdateTimeout = setTimeout(()=>{
this.deferredUpdateTree(selectedWidgets)
})
}
}
deferredUpdateTree(selectedWidgets) {
this.deferredUpdateTimeout = null
for (var s of this.sortables) {
s.destroy()
}