mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-19 22:34:15 +00:00
type implementation for detailed descriptions
Previously, description was a simple string, but supporting more complex descriptions requires that new data be passed. The type of a nodes description has been updated to be either a simple string as before, or an array consisting of short description string, an html string for the full description, and a placeholder dict for future usage. Definitions and usage points for description have been updated to accommodate this change
This commit is contained in:
@@ -149,8 +149,8 @@ function updateNode(node) {
|
||||
return
|
||||
}
|
||||
helpDOM.def = def
|
||||
if (def.longDescription) {
|
||||
helpDOM.innerHTML = def.longDescription
|
||||
if (Array.isArray(def.description)) {
|
||||
helpDOM.innerHTML = def.description[1]
|
||||
} else {
|
||||
//do additional parsing to prettify output and combine tooltips
|
||||
let content = ''
|
||||
@@ -189,15 +189,6 @@ function updateNode(node) {
|
||||
helpDOM.innerHTML = content
|
||||
}
|
||||
}
|
||||
app.registerExtension({
|
||||
name: 'Comfy.longformDocumentation',
|
||||
async beforeRegisterNodeDef(nodeType, nodeData, app) {
|
||||
//TODO: Find better method. Likely require explicit opt in
|
||||
if (nodeData.description.includes('</div>') && !nodeData.longDescription) {
|
||||
nodeData.longDescription = nodeData.description
|
||||
}
|
||||
}
|
||||
})
|
||||
var bringToFront
|
||||
let documentationSidebar = {
|
||||
id: 'documentationSidebar',
|
||||
|
||||
Reference in New Issue
Block a user