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