mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-10 18:10:08 +00:00
Move keybinds to coreKeybindings (#1078)
* Refactor core keybinds * Prevent default * Add playwright test
This commit is contained in:
@@ -5,10 +5,7 @@ import { ComfySettingsDialog } from './ui/settings'
|
||||
import { ComfyApp, app } from './app'
|
||||
import { TaskItem } from '@/types/apiTypes'
|
||||
import { showSettingsDialog } from '@/services/dialogService'
|
||||
import { useToastStore } from '@/stores/toastStore'
|
||||
import { LGraphGroup } from '@comfyorg/litegraph'
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
import { useTitleEditorStore } from '@/stores/graphStore'
|
||||
|
||||
export const ComfyDialog = _ComfyDialog
|
||||
|
||||
@@ -695,32 +692,6 @@ export class ComfyUI {
|
||||
onclick: async () => {
|
||||
app.resetView()
|
||||
}
|
||||
}),
|
||||
$el('button', {
|
||||
id: 'comfy-group-selected-nodes-button',
|
||||
textContent: 'Group',
|
||||
hidden: true,
|
||||
onclick: () => {
|
||||
if (
|
||||
!app.canvas.selected_nodes ||
|
||||
Object.keys(app.canvas.selected_nodes).length === 0
|
||||
) {
|
||||
useToastStore().add({
|
||||
severity: 'error',
|
||||
summary: 'No nodes selected',
|
||||
detail: 'Please select nodes to group',
|
||||
life: 3000
|
||||
})
|
||||
return
|
||||
}
|
||||
const group = new LGraphGroup()
|
||||
const padding = useSettingStore().get(
|
||||
'Comfy.GroupSelectedNodes.Padding'
|
||||
)
|
||||
group.addNodes(Object.values(app.canvas.selected_nodes), padding)
|
||||
app.canvas.graph.add(group)
|
||||
useTitleEditorStore().titleEditorTarget = group
|
||||
}
|
||||
})
|
||||
]) as HTMLDivElement
|
||||
|
||||
|
||||
Reference in New Issue
Block a user