mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-28 02:02:08 +00:00
Manage searchbox imp setting in Vue app (#282)
* Manage searchbox setting in vue * nit
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
import SideToolBar from '@/components/sidebar/SideToolBar.vue'
|
import SideToolBar from '@/components/sidebar/SideToolBar.vue'
|
||||||
import LiteGraphCanvasSplitterOverlay from '@/components/LiteGraphCanvasSplitterOverlay.vue'
|
import LiteGraphCanvasSplitterOverlay from '@/components/LiteGraphCanvasSplitterOverlay.vue'
|
||||||
import NodeSearchboxPopover from '@/components/NodeSearchBoxPopover.vue'
|
import NodeSearchboxPopover from '@/components/NodeSearchBoxPopover.vue'
|
||||||
import { ref, onMounted, computed, onUnmounted } from 'vue'
|
import { ref, computed, onUnmounted, watch, onMounted } from 'vue'
|
||||||
import { app as comfyApp } from '@/scripts/app'
|
import { app as comfyApp } from '@/scripts/app'
|
||||||
import { useSettingStore } from '@/stores/settingStore'
|
import { useSettingStore } from '@/stores/settingStore'
|
||||||
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'
|
import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter'
|
||||||
@@ -32,6 +32,9 @@ const betaMenuEnabled = computed(
|
|||||||
const nodeSearchEnabled = computed<boolean>(
|
const nodeSearchEnabled = computed<boolean>(
|
||||||
() => settingStore.get('Comfy.NodeSearchBoxImpl') === 'default'
|
() => settingStore.get('Comfy.NodeSearchBoxImpl') === 'default'
|
||||||
)
|
)
|
||||||
|
watch(nodeSearchEnabled, (newVal) => {
|
||||||
|
comfyApp.canvas.allow_searchbox = !newVal
|
||||||
|
})
|
||||||
|
|
||||||
let dropTargetCleanup = () => {}
|
let dropTargetCleanup = () => {}
|
||||||
|
|
||||||
@@ -40,6 +43,7 @@ onMounted(async () => {
|
|||||||
|
|
||||||
workspaceStore.spinner = true
|
workspaceStore.spinner = true
|
||||||
await comfyApp.setup(canvasRef.value)
|
await comfyApp.setup(canvasRef.value)
|
||||||
|
comfyApp.canvas.allow_searchbox = !nodeSearchEnabled.value
|
||||||
workspaceStore.spinner = false
|
workspaceStore.spinner = false
|
||||||
|
|
||||||
window['app'] = comfyApp
|
window['app'] = comfyApp
|
||||||
|
|||||||
@@ -1881,7 +1881,6 @@ export class ComfyApp {
|
|||||||
this.#addAfterConfigureHandler()
|
this.#addAfterConfigureHandler()
|
||||||
|
|
||||||
this.canvas = new LGraphCanvas(canvasEl, this.graph)
|
this.canvas = new LGraphCanvas(canvasEl, this.graph)
|
||||||
this.ui.settings.refreshSetting('Comfy.NodeSearchBoxImpl')
|
|
||||||
this.ctx = canvasEl.getContext('2d')
|
this.ctx = canvasEl.getContext('2d')
|
||||||
|
|
||||||
LiteGraph.release_link_on_empty_shows_menu = true
|
LiteGraph.release_link_on_empty_shows_menu = true
|
||||||
|
|||||||
@@ -425,14 +425,7 @@ export class ComfyUI {
|
|||||||
name: 'Node Search box implementation',
|
name: 'Node Search box implementation',
|
||||||
type: 'combo',
|
type: 'combo',
|
||||||
options: ['default', 'litegraph (legacy)'],
|
options: ['default', 'litegraph (legacy)'],
|
||||||
defaultValue: 'default',
|
defaultValue: 'default'
|
||||||
onChange: (value?: string) => {
|
|
||||||
if (!app.canvas) return
|
|
||||||
|
|
||||||
value = value || 'default'
|
|
||||||
const useLitegraphSearch = value === 'litegraph (legacy)'
|
|
||||||
app.canvas.allow_searchbox = useLitegraphSearch
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const fileInput = $el('input', {
|
const fileInput = $el('input', {
|
||||||
|
|||||||
Reference in New Issue
Block a user