mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
feature: consistant behavior of hit enter on search results
This commit is contained in:
parent
de5b67bb2f
commit
b08cc31940
1 changed files with 9 additions and 10 deletions
|
|
@ -144,17 +144,16 @@ export const handleKeyDown: BoundMethodCreator<[React.KeyboardEvent]> = dispatch
|
|||
break
|
||||
case 'Enter':
|
||||
// expand node or redirect to file page
|
||||
if (focusedNode.type === 'tree') {
|
||||
if (searched) {
|
||||
dispatch.call(goTo, focusedNode.path.split('/'))
|
||||
} else {
|
||||
dispatch.call(setExpand, focusedNode, true)
|
||||
if (searched) {
|
||||
dispatch.call(goTo, focusedNode.path.split('/'))
|
||||
} else {
|
||||
if (focusedNode.type === 'tree') {
|
||||
dispatch.call(toggleNodeExpansion, focusedNode, { recursive: event.altKey })
|
||||
} else if (focusedNode.type === 'blob') {
|
||||
if (focusedNode.url) loadWithPJAX(focusedNode.url)
|
||||
} else if (focusedNode.type === 'commit') {
|
||||
window.open(focusedNode.url)
|
||||
}
|
||||
} else if (focusedNode.type === 'blob') {
|
||||
if (searched) dispatch.call(goTo, focusedNode.path.split('/'))
|
||||
else if (focusedNode.url) loadWithPJAX(focusedNode.url)
|
||||
} else if (focusedNode.type === 'commit') {
|
||||
window.open(focusedNode.url)
|
||||
}
|
||||
break
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in a new issue