Skip to content

Commit

Permalink
fix: fix sidebar navigation on mobile devices (#1618)
Browse files Browse the repository at this point in the history
  • Loading branch information
niubility000 committed Oct 19, 2021
1 parent 6f345be commit f09bf3e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions frontend/src/components/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template>
<nav :class="{ active }">
<template v-if="isLogged">
<router-link
<button
class="action"
to="/files/"
@click="toRoot"
:aria-label="$t('sidebar.myFiles')"
:title="$t('sidebar.myFiles')"
>
<i class="material-icons">folder</i>
<span>{{ $t("sidebar.myFiles") }}</span>
</router-link>
</button>

<div v-if="user.perm.create">
<button
Expand All @@ -34,15 +34,15 @@
</div>

<div>
<router-link
<button
class="action"
to="/settings"
@click="toSettings"
:aria-label="$t('sidebar.settings')"
:title="$t('sidebar.settings')"
>
<i class="material-icons">settings_applications</i>
<span>{{ $t("sidebar.settings") }}</span>
</router-link>
</button>

<button
v-if="authMethod == 'json'"
Expand Down Expand Up @@ -125,6 +125,14 @@ export default {
authMethod: () => authMethod,
},
methods: {
toRoot() {
this.$router.push({ path: "/files/" }, () => {});
this.$store.commit("closeHovers");
},
toSettings() {
this.$router.push({ path: "/settings" }, () => {});
this.$store.commit("closeHovers");
},
help() {
this.$store.commit("showHover", "help");
},
Expand Down

0 comments on commit f09bf3e

Please sign in to comment.