mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
style: Apply linter fixes to layout system
This commit is contained in:
@@ -131,7 +131,7 @@ import type {
|
|||||||
NodeState,
|
NodeState,
|
||||||
VueNodeData
|
VueNodeData
|
||||||
} from '@/composables/graph/useGraphNodeManager'
|
} from '@/composables/graph/useGraphNodeManager'
|
||||||
import { useLayoutSync } from '@/composables/graph/useLayout'
|
import { useLayout, useLayoutSync } from '@/composables/graph/useLayout'
|
||||||
import { useNodeBadge } from '@/composables/node/useNodeBadge'
|
import { useNodeBadge } from '@/composables/node/useNodeBadge'
|
||||||
import { useCanvasDrop } from '@/composables/useCanvasDrop'
|
import { useCanvasDrop } from '@/composables/useCanvasDrop'
|
||||||
import { useContextMenuTranslation } from '@/composables/useContextMenuTranslation'
|
import { useContextMenuTranslation } from '@/composables/useContextMenuTranslation'
|
||||||
@@ -174,6 +174,7 @@ const workspaceStore = useWorkspaceStore()
|
|||||||
const canvasStore = useCanvasStore()
|
const canvasStore = useCanvasStore()
|
||||||
const executionStore = useExecutionStore()
|
const executionStore = useExecutionStore()
|
||||||
const toastStore = useToastStore()
|
const toastStore = useToastStore()
|
||||||
|
const { mutations: layoutMutations } = useLayout()
|
||||||
const betaMenuEnabled = computed(
|
const betaMenuEnabled = computed(
|
||||||
() => settingStore.get('Comfy.UseNewMenu') !== 'Disabled'
|
() => settingStore.get('Comfy.UseNewMenu') !== 'Disabled'
|
||||||
)
|
)
|
||||||
@@ -479,13 +480,12 @@ const handleNodeSelect = (event: PointerEvent, nodeData: VueNodeData) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
canvasStore.canvas.selectNode(node)
|
canvasStore.canvas.selectNode(node)
|
||||||
|
|
||||||
// Bring node to front when clicked (similar to LiteGraph behavior)
|
// Bring node to front when clicked (similar to LiteGraph behavior)
|
||||||
// Skip if node is pinned
|
// Skip if node is pinned
|
||||||
if (!node.flags?.pinned) {
|
if (!node.flags?.pinned) {
|
||||||
const { mutations } = useLayout()
|
layoutMutations.setSource('vue')
|
||||||
mutations.setSource('vue')
|
layoutMutations.bringNodeToFront(nodeData.id)
|
||||||
mutations.bringNodeToFront(nodeData.id)
|
|
||||||
}
|
}
|
||||||
node.selected = true
|
node.selected = true
|
||||||
|
|
||||||
|
|||||||
@@ -134,13 +134,13 @@ class LayoutMutationsImpl implements LayoutMutations {
|
|||||||
// Get all nodes to find the highest z-index
|
// Get all nodes to find the highest z-index
|
||||||
const allNodes = layoutStore.getAllNodes().value
|
const allNodes = layoutStore.getAllNodes().value
|
||||||
let maxZIndex = 0
|
let maxZIndex = 0
|
||||||
|
|
||||||
for (const [_, layout] of allNodes) {
|
for (const [, layout] of allNodes) {
|
||||||
if (layout.zIndex > maxZIndex) {
|
if (layout.zIndex > maxZIndex) {
|
||||||
maxZIndex = layout.zIndex
|
maxZIndex = layout.zIndex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set this node's z-index to be one higher than the current max
|
// Set this node's z-index to be one higher than the current max
|
||||||
this.setNodeZIndex(nodeId, maxZIndex + 1)
|
this.setNodeZIndex(nodeId, maxZIndex + 1)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user