Close navbar when submitting search
Closes #366 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
4301842c1e
commit
27c73c4646
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<b-navbar type="is-secondary" wrapper-class="container">
|
<b-navbar type="is-secondary" wrapper-class="container" :active.sync="mobileNavbarActive">
|
||||||
<template slot="brand">
|
<template slot="brand">
|
||||||
<b-navbar-item tag="router-link" :to="{ name: RouteName.HOME }" :aria-label="$t('Home')">
|
<b-navbar-item tag="router-link" :to="{ name: RouteName.HOME }" :aria-label="$t('Home')">
|
||||||
<logo />
|
<logo />
|
||||||
@ -26,7 +26,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot="end">
|
<template slot="end">
|
||||||
<b-navbar-item tag="div">
|
<b-navbar-item tag="div">
|
||||||
<search-field />
|
<search-field @navbar-search="mobileNavbarActive = false" />
|
||||||
</b-navbar-item>
|
</b-navbar-item>
|
||||||
|
|
||||||
<b-navbar-dropdown v-if="currentActor.id && currentUser.isLoggedIn" right>
|
<b-navbar-dropdown v-if="currentActor.id && currentUser.isLoggedIn" right>
|
||||||
@ -157,6 +157,8 @@ export default class NavBar extends Vue {
|
|||||||
|
|
||||||
RouteName = RouteName;
|
RouteName = RouteName;
|
||||||
|
|
||||||
|
mobileNavbarActive: boolean = false;
|
||||||
|
|
||||||
@Watch("currentActor")
|
@Watch("currentActor")
|
||||||
async initializeListOfIdentities() {
|
async initializeListOfIdentities() {
|
||||||
if (!this.currentUser.isLoggedIn) return;
|
if (!this.currentUser.isLoggedIn) return;
|
||||||
|
@ -24,6 +24,7 @@ export default class SearchField extends Vue {
|
|||||||
search: string = "";
|
search: string = "";
|
||||||
|
|
||||||
enter() {
|
enter() {
|
||||||
|
this.$emit("navbar-search");
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: RouteName.SEARCH,
|
name: RouteName.SEARCH,
|
||||||
query: { term: this.search },
|
query: { term: this.search },
|
||||||
|
Loading…
Reference in New Issue
Block a user