Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: inconsistent sidebar group toggle on navigation #182

Merged
merged 2 commits into from
Aug 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

<b-menu-item :expanded="activeGroup.lists"
:active="activeGroup.lists"
v-on:update:active="(state) => toggleGroup('lists', state)"
icon="format-list-bulleted-square" label="Lists">
<b-menu-item :to="{name: 'lists'}" tag="router-link"
:active="activeItem.lists"
Expand All @@ -45,6 +46,7 @@

<b-menu-item :expanded="activeGroup.subscribers"
:active="activeGroup.subscribers"
v-on:update:active="(state) => toggleGroup('subscribers', state)"
icon="account-multiple" label="Subscribers">
<b-menu-item :to="{name: 'subscribers'}" tag="router-link"
:active="activeItem.subscribers"
Expand All @@ -56,8 +58,9 @@
</b-menu-item><!-- subscribers -->

<b-menu-item :expanded="activeGroup.campaigns"
:active="activeGroup.campaigns"
icon="rocket-launch-outline" label="Campaigns">
:active="activeGroup.campaigns"
v-on:update:active="(state) => toggleGroup('campaigns', state)"
icon="rocket-launch-outline" label="Campaigns">
<b-menu-item :to="{name: 'campaigns'}" tag="router-link"
:active="activeItem.campaigns"
icon="rocket-launch-outline" label="All campaigns"></b-menu-item>
Expand Down Expand Up @@ -150,6 +153,9 @@ export default Vue.extend({
},

methods: {
toggleGroup(group, state) {
this.activeGroup = state ? { [group]: true } : {};
},
reloadApp() {
this.$api.reloadApp().then(() => {
this.$utils.toast('Reloading app ...');
Expand Down
2 changes: 1 addition & 1 deletion frontend/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
// and the URI for assets are tightly coupled. This is handled in the Go app
// by using stuffbin aliases.
assetsDir: 'frontend',

// Move the index.html file from dist/index.html to dist/frontend/index.html
indexPath: './frontend/index.html',

Expand Down