Skip to content

Commit

Permalink
Rename onNonLeafClick to toggleNodeOnEvent (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Aug 24, 2024
1 parent 5dec868 commit 74baf2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/sidebar/tabs/NodeLibrarySidebarTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/treeHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -68,6 +68,6 @@ export function useTreeExpansion() {
toggleNodeRecursive,
expandNode,
collapseNode,
onNonLeafClick
toggleNodeOnEvent
}
}

0 comments on commit 74baf2a

Please sign in to comment.