mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-25 17:24:07 +00:00
Move render callback to trigger on node change
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user