mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
feat: recursive toggle with keyboard arrow
This commit is contained in:
parent
6c433f1f17
commit
70e9bc68c3
1 changed files with 2 additions and 2 deletions
|
|
@ -114,7 +114,7 @@ export const handleKeyDown: BoundMethodCreator<[React.KeyboardEvent]> = dispatch
|
|||
|
||||
case 'ArrowLeft':
|
||||
if (expandedNodes.has(focusedNode.path)) {
|
||||
dispatch.call(setExpand, focusedNode, false)
|
||||
dispatch.call(toggleNodeExpansion, focusedNode, { recursive: event.altKey })
|
||||
} else {
|
||||
// go forward to the start of the list, find the closest node with lower depth
|
||||
const parentNode = getVisibleParentNode(nodes, focusedNode)
|
||||
|
|
@ -134,7 +134,7 @@ export const handleKeyDown: BoundMethodCreator<[React.KeyboardEvent]> = dispatch
|
|||
dispatch.call(focusNode, nextNode)
|
||||
}
|
||||
} else {
|
||||
dispatch.call(setExpand, focusedNode, true)
|
||||
dispatch.call(toggleNodeExpansion, focusedNode, { recursive: event.altKey })
|
||||
}
|
||||
} else if (focusedNode.type === 'blob') {
|
||||
if (focusedNode.url) loadWithPJAX(focusedNode.url)
|
||||
|
|
|
|||
Loading…
Reference in a new issue