Rename onNonLeafClick to toggleNodeOnEvent (#621)

This commit is contained in:
Chenlei Hu
2024-08-24 18:09:55 -04:00
committed by GitHub
parent 5dec86861b
commit 74baf2af12
2 changed files with 4 additions and 4 deletions

View File

@@ -95,7 +95,7 @@ import _ from 'lodash'
import { useTreeExpansion } from '@/hooks/treeHooks'
const nodeDefStore = useNodeDefStore()
const { expandedKeys, expandNode, onNonLeafClick } = useTreeExpansion()
const { expandedKeys, expandNode, toggleNodeOnEvent } = useTreeExpansion()
const alphabeticalSort = ref(false)
const hoveredComfyNodeName = ref<string | null>(null)
@@ -252,7 +252,7 @@ const handleSearch = (query: string) => {
const onNodeContentClick = (e: MouseEvent, node: TreeNode) => {
if (!node.key) return
if (node.type === 'folder') {
onNonLeafClick(e, node)
toggleNodeOnEvent(e, node)
} else {
insertNode(node.data)
}

View File

@@ -54,7 +54,7 @@ export function useTreeExpansion() {
}
}
const onNonLeafClick = (e: MouseEvent, node: TreeNode) => {
const toggleNodeOnEvent = (e: MouseEvent | KeyboardEvent, node: TreeNode) => {
if (e.ctrlKey) {
toggleNodeRecursive(node)
} else {
@@ -68,6 +68,6 @@ export function useTreeExpansion() {
toggleNodeRecursive,
expandNode,
collapseNode,
onNonLeafClick
toggleNodeOnEvent
}
}