mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
Fix ComfyUI class setup procedure (#846)
This commit is contained in:
@@ -373,7 +373,7 @@ export class ComfyUI {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// For testing. Legacy ui tests don't have vue app initialized.
|
// For testing. Legacy ui tests don't have vue app initialized.
|
||||||
if (!app.vueAppReady) {
|
if (window['IS_TEST']) {
|
||||||
this.setup(document.body)
|
this.setup(document.body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,7 +181,9 @@ export class ComfyAppMenu {
|
|||||||
resizeHandler = null
|
resizeHandler = null
|
||||||
}
|
}
|
||||||
document.body.style.removeProperty('display')
|
document.body.style.removeProperty('display')
|
||||||
app.ui.menuContainer.style.removeProperty('display')
|
if (app.ui.menuContainer) {
|
||||||
|
app.ui.menuContainer.style.removeProperty('display')
|
||||||
|
}
|
||||||
this.element.style.display = 'none'
|
this.element.style.display = 'none'
|
||||||
app.ui.restoreMenuPosition()
|
app.ui.restoreMenuPosition()
|
||||||
}
|
}
|
||||||
@@ -192,7 +194,9 @@ export class ComfyAppMenu {
|
|||||||
|
|
||||||
updatePosition(v: MenuPosition) {
|
updatePosition(v: MenuPosition) {
|
||||||
document.body.style.display = 'grid'
|
document.body.style.display = 'grid'
|
||||||
this.app.ui.menuContainer.style.display = 'none'
|
if (this.app.ui.menuContainer) {
|
||||||
|
this.app.ui.menuContainer.style.display = 'none'
|
||||||
|
}
|
||||||
this.element.style.removeProperty('display')
|
this.element.style.removeProperty('display')
|
||||||
this.position = v
|
this.position = v
|
||||||
if (v === 'Bottom') {
|
if (v === 'Bottom') {
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export async function start(config: StartConfig = {}): Promise<StartResult> {
|
|||||||
|
|
||||||
Object.assign(localStorage, config.localStorage ?? {})
|
Object.assign(localStorage, config.localStorage ?? {})
|
||||||
document.body.innerHTML = html.toString()
|
document.body.innerHTML = html.toString()
|
||||||
|
window['IS_TEST'] = true
|
||||||
|
|
||||||
mockApi(config)
|
mockApi(config)
|
||||||
mockSettingStore()
|
mockSettingStore()
|
||||||
|
|||||||
Reference in New Issue
Block a user