minor fixes & stacktrace folding in terminal

This commit is contained in:
bordun 2020-03-13 16:28:43 +01:00
parent f58db44858
commit c4559315f7
11 changed files with 56 additions and 17 deletions

View file

@ -89,6 +89,8 @@ class UiTree extends UiWidget {
var content = this.parseWidgets(widgetManager.getWidgetById('root')[0], selectedWidgets)
if (!content) return
// morph DOM
if (this.mounted) {
morph(this.list.firstChild, content)
@ -155,6 +157,8 @@ class UiTree extends UiWidget {
parseWidgets(widget, selectedWidgets, depth = 1) {
if (!widget) return
var selected = selectedWidgets.includes(widget),
id = widget.getProp('id'),
node = html`<li class="${selected ? 'editing' : ''} ${!widget.getProp('visible') ? 'invisible' : ''}"
@ -168,7 +172,7 @@ class UiTree extends UiWidget {
if (this.expanded[id]) node.classList.add('expanded')
var sublist = node.appendChild(html`<ol style="--depth:${++depth};"></ol>`)
for (let child of widget.children) {
sublist.appendChild(this.parseWidgets(child, selectedWidgets, depth))
if (child) sublist.appendChild(this.parseWidgets(child, selectedWidgets, depth))
}
}