Mercurial > gemma
changeset 555:f66116b3a249
fix: Reset collapse state of sidebar
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 03 Sep 2018 12:57:33 +0200 |
parents | fa4f623e3ca6 |
children | 09d8e5483851 |
files | client/src/components/Topbar.vue client/src/stores/application.js |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/Topbar.vue Mon Sep 03 12:50:43 2018 +0200 +++ b/client/src/components/Topbar.vue Mon Sep 03 12:57:33 2018 +0200 @@ -83,6 +83,7 @@ }, logoff() { this.$store.commit("user/clear_auth"); + this.$store.commit("application/resetSidebar"); this.$router.push("/login"); } },
--- a/client/src/stores/application.js Mon Sep 03 12:50:43 2018 +0200 +++ b/client/src/stores/application.js Mon Sep 03 12:57:33 2018 +0200 @@ -1,10 +1,12 @@ +const defaultCollapseState = true; + const Application = { namespaced: true, state: { appTitle: process.env.VUE_APP_TITLE, secondaryLogo: process.env.VUE_APP_SECONDARY_LOGO_URL, sidebar: { - iscollapsed: true + iscollapsed: defaultCollapseState }, countries: ["AT", "SK", "HU", "HR", "RS", "BiH", "BG", "RO", "UA"] }, @@ -25,6 +27,9 @@ mutations: { toggleSidebar: state => { state.sidebar.iscollapsed = !state.sidebar.iscollapsed; + }, + resetSidebar: state => { + state.sidebar.iscollapsed = defaultCollapseState; } }, actions: {}