Close search with escape

This commit is contained in:
2023-05-29 12:33:22 +02:00
parent 71538e5d7a
commit 34bd15fa8b
3 changed files with 40 additions and 26 deletions

View File

@@ -43,7 +43,9 @@ let state = {
shuffle: false,
}
onMount(() => fs_navigator.open_node(window.initial_node, false))
onMount(() => {
fs_navigator.open_node(window.initial_node, false)
})
const keydown = e => {
if (e.ctrlKey || e.altKey || e.metaKey) {
@@ -115,10 +117,6 @@ const loading_evt = e => {
bind:this={fs_navigator}
bind:state
on:loading={loading_evt}
on:navigation_complete={() => {
// Reset the view to the file view if we were in search view
view = "file"
}}
/>
<div class="file_viewer">
@@ -155,6 +153,7 @@ const loading_evt = e => {
state={state}
fs_navigator={fs_navigator}
on:loading={loading_evt}
on:done={() => {view = "file"}}
/>
{/if}
</div>