Skip to content

Commit

Permalink
Merge pull request knadh#181 from scmmishra/fix-sidebar
Browse files Browse the repository at this point in the history
fix: inconsistent active link on sidebar navigation
  • Loading branch information
knadh authored Aug 24, 2020
2 parents 0f055ea + 3b141bb commit 9147a92
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
</b-menu-item><!-- dashboard -->

<b-menu-item :expanded="activeGroup.lists"
:active="activeGroup.lists"
icon="format-list-bulleted-square" label="Lists">
<b-menu-item :to="{name: 'lists'}" tag="router-link"
:active="activeItem.lists"
Expand All @@ -43,6 +44,7 @@
</b-menu-item><!-- lists -->

<b-menu-item :expanded="activeGroup.subscribers"
:active="activeGroup.subscribers"
icon="account-multiple" label="Subscribers">
<b-menu-item :to="{name: 'subscribers'}" tag="router-link"
:active="activeItem.subscribers"
Expand All @@ -54,6 +56,7 @@
</b-menu-item><!-- subscribers -->

<b-menu-item :expanded="activeGroup.campaigns"
:active="activeGroup.campaigns"
icon="rocket-launch-outline" label="Campaigns">
<b-menu-item :to="{name: 'campaigns'}" tag="router-link"
:active="activeItem.campaigns"
Expand Down Expand Up @@ -138,6 +141,10 @@ export default Vue.extend({
this.activeItem = { [to.name]: true };
if (to.meta.group) {
this.activeGroup = { [to.meta.group]: true };
} else {
// Reset activeGroup to collapse menu items on navigating
// to non group items from sidebar
this.activeGroup = {};
}
},
},
Expand Down

0 comments on commit 9147a92

Please sign in to comment.