Move render callback to trigger on node change

This commit is contained in:
Austin Mroz
2024-10-03 18:26:58 -05:00
parent 3b679f1194
commit bc6630742b

View File

@@ -42,9 +42,6 @@ function collapseOnClick() {
let doCollapse = this.children[0].innerHTML == '-'
setCollapse(this.parentElement, doCollapse)
}
//TODO: connect with doc tooltips
//If doc sidebar is opened, the current node should not display tooltips,
//but navigate the sidebar pane as appropriate.
function selectHelp(name: string, value?: string) {
if (cdef[2]?.select) {
return cdef[2].select(this, name, value)
@@ -156,6 +153,9 @@ function updateNode(node?) {
}
content = '<div class="doc-node">' + def.display_name + '</div>' + content
helpDOM.innerHTML = content
if (cdef.description[2]?.render) {
cdef.description[2].render(helpDOM)
}
}
}
let docStyleElement = document.createElement('style')
@@ -201,9 +201,6 @@ class DocumentationSidebar implements CustomSidebarTabExtension {
if (!e?.children?.length) {
e.appendChild(helpDOM)
}
if (cdef.description[2]?.render) {
cdef.description[2].render(e)
}
}
}
app.extensionManager.registerSidebarTab(new DocumentationSidebar())