Enable searching in all directories
This commit is contained in:
@@ -260,10 +260,7 @@ onMount(() => {
|
|||||||
>
|
>
|
||||||
<div class="width_container">
|
<div class="width_container">
|
||||||
{#if mode === "viewing"}
|
{#if mode === "viewing"}
|
||||||
<!-- Search only works in the user's home directory -->
|
<SearchBar nav={nav}/>
|
||||||
{#if $nav.path[0] && $nav.path[0].id === "me"}
|
|
||||||
<SearchBar nav={nav}/>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<button on:click={navigate_back} title="Back">
|
<button on:click={navigate_back} title="Back">
|
||||||
|
@@ -97,7 +97,6 @@ const input_keydown = e => {
|
|||||||
const input_keyup = e => {
|
const input_keyup = e => {
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
clear_search(true)
|
clear_search(true)
|
||||||
e.preventDefault()
|
|
||||||
} else if (e.key === "ArrowUp") {
|
} else if (e.key === "ArrowUp") {
|
||||||
if (selected_result > 0) {
|
if (selected_result > 0) {
|
||||||
selected_result--
|
selected_result--
|
||||||
@@ -170,6 +169,12 @@ const window_keydown = (e) => {
|
|||||||
on:keydown={input_keydown}
|
on:keydown={input_keydown}
|
||||||
on:keyup={input_keyup}
|
on:keyup={input_keyup}
|
||||||
/>
|
/>
|
||||||
|
{#if search_term !== ""}
|
||||||
|
<!-- Button needs to be of button type in order to not submit the form -->
|
||||||
|
<button on:click={clear_search} type="button">
|
||||||
|
<i class="icon">close</i>
|
||||||
|
</button>
|
||||||
|
{/if}
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="results">
|
<div class="results">
|
||||||
|
Reference in New Issue
Block a user