search page only appears on enter
This commit is contained in:
parent
ce598e8b2c
commit
350521ddaf
4 changed files with 9 additions and 6 deletions
|
@ -25,6 +25,7 @@ const app = new Vue({
|
|||
cursor: -1,
|
||||
hints: [],
|
||||
showHints: false,
|
||||
showSearchView: false,
|
||||
results: {},
|
||||
resultsSocial: {},
|
||||
resultsLibrary: {},
|
||||
|
@ -1904,6 +1905,8 @@ const app = new Vue({
|
|||
async getSearchHints() {
|
||||
if (this.search.term == "") {
|
||||
this.search.hints = [];
|
||||
this.search.showHints = true
|
||||
this.search.showSearchView = false
|
||||
return;
|
||||
}
|
||||
let hints = await (
|
||||
|
|
|
@ -280,7 +280,7 @@
|
|||
<input type="search" spellcheck="false" @click="$root.appRoute('search');search.showHints = true"
|
||||
@focus="search.showHints = true"
|
||||
@blur="setTimeout(()=>{if(hintscontext != true){search.showHints = false} }, 300)"
|
||||
v-on:keyup.enter="searchQuery(search.hints[search.cursor]?.content ?? search.hints[search.cursor]?.searchTerm ?? search.term);search.showHints = false;search.cursor = -1" @change="$root.appRoute('search');"
|
||||
v-on:keyup.enter="searchQuery(search.hints[search.cursor]?.content ?? search.hints[search.cursor]?.searchTerm ?? search.term);search.showHints = false;search.showSearchView = true;search.cursor = -1" @change="$root.appRoute('search');"
|
||||
v-on:keyup="searchCursor"
|
||||
@input="getSearchHints()"
|
||||
:placeholder="$root.getLz('term.search') + '...'" v-model="search.term" ref="searchInput"
|
||||
|
@ -294,7 +294,7 @@
|
|||
</button>
|
||||
<template v-for="(item, position) in search.hints.filter((a) => {return a.content != null})">
|
||||
<mediaitem-smarthints :item="item.content" :position="position"> </mediaitem-smarthints>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
@click="$root.appRoute('search');$root.search.showHints = true"
|
||||
@focus="$root.search.showHints = true"
|
||||
@blur="$root.setTimeout(()=>{if($root.hintscontext != true){$root.search.showHints = false} }, 300)"
|
||||
v-on:keyup.enter="$root.searchQuery($root.search.hints[$root.search.cursor]?.content ?? $root.search.hints[$root.search.cursor]?.searchTerm ?? $root.search.term);$root.search.showHints = false;$root.search.cursor = -1"
|
||||
v-on:keyup.enter="$root.searchQuery($root.search.hints[$root.search.cursor]?.content ?? $root.search.hints[$root.search.cursor]?.searchTerm ?? $root.search.term);$root.search.showHints = false;$root.search.showSearchView = true;$root.search.cursor = -1"
|
||||
v-on:keyup="$root.searchCursor"
|
||||
@change="$root.appRoute('search');"
|
||||
@input="$root.getSearchHints()"
|
||||
|
@ -34,7 +34,7 @@
|
|||
</button>
|
||||
<template v-for="(item, position) in $root.search.hints.filter((a) => {return a.content != null})">
|
||||
<mediaitem-smarthints :item="item.content" :position="position"> </mediaitem-smarthints>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<div class="search-input--icon"></div>
|
||||
<input type="search" spellcheck="false" @focus="$root.search.showHints = true"
|
||||
@blur="$root.setTimeout(()=>{if($root.hintscontext != true){$root.search.showHints = false} }, 300)"
|
||||
v-on:keyup.enter="$root.searchQuery($root.search.hints[$root.search.cursor]?.content ?? $root.search.hints[$root.search.cursor]?.searchTerm ?? $root.search.term);$root.search.showHints = false" @input="$root.getSearchHints()"
|
||||
v-on:keyup.enter="$root.searchQuery($root.search.hints[$root.search.cursor]?.content ?? $root.search.hints[$root.search.cursor]?.searchTerm ?? $root.search.term);$root.search.showHints = false; $root.search.showSearchView = true" @input="$root.getSearchHints()"
|
||||
:placeholder="$root.getLz('term.search') + '...'" v-model="$root.search.term"
|
||||
class="search-input" />
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
|||
$root.getLz("term.library") }}
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="search != null && search != [] && search.term != ''">
|
||||
<div v-if="search != null && search != [] && search.term != '' && $root.search.showSearchView">
|
||||
<template v-if="searchType == 'catalog'">
|
||||
<h3>{{app.getLz('term.topResult')}}</h3>
|
||||
<mediaitem-scroller-horizontal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue