File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,16 @@ import { useSettingStore } from '@/stores/settingStore'
2222import { dropTargetForElements } from ' @atlaskit/pragmatic-drag-and-drop/element/adapter'
2323import { useNodeDefStore } from ' @/stores/nodeDefStore'
2424import { useWorkspaceStore } from ' @/stores/workspaceStateStore'
25+ import {
26+ LiteGraph ,
27+ LGraph ,
28+ LLink ,
29+ LGraphNode ,
30+ LGraphGroup ,
31+ DragAndScale ,
32+ LGraphCanvas ,
33+ ContextMenu
34+ } from ' @comfyorg/litegraph'
2535
2636const emit = defineEmits ([' ready' ])
2737const canvasRef = ref <HTMLCanvasElement | null >(null )
@@ -41,6 +51,17 @@ watch(nodeSearchEnabled, (newVal) => {
4151let dropTargetCleanup = () => {}
4252
4353onMounted (async () => {
54+ // Backward compatible
55+ // Assign all properties of lg to window
56+ window [' LiteGraph' ] = LiteGraph
57+ window [' LGraph' ] = LGraph
58+ window [' LLink' ] = LLink
59+ window [' LGraphNode' ] = LGraphNode
60+ window [' LGraphGroup' ] = LGraphGroup
61+ window [' DragAndScale' ] = DragAndScale
62+ window [' LGraphCanvas' ] = LGraphCanvas
63+ window [' ContextMenu' ] = ContextMenu
64+
4465 comfyApp .vueAppReady = true
4566
4667 workspaceStore .spinner = true
You can’t perform that action at this time.
0 commit comments