diff options
Diffstat (limited to 'settings/src')
-rw-r--r-- | settings/src/components/appNavigation/navigationItem.vue | 29 | ||||
-rw-r--r-- | settings/src/views/Users.vue | 2 |
2 files changed, 23 insertions, 8 deletions
diff --git a/settings/src/components/appNavigation/navigationItem.vue b/settings/src/components/appNavigation/navigationItem.vue index 1537aeb3fd0..80584517b99 100644 --- a/settings/src/components/appNavigation/navigationItem.vue +++ b/settings/src/components/appNavigation/navigationItem.vue @@ -1,5 +1,5 @@ <template> - <router-link :to="item.router" tag="li" :id="item.id" exact + <nav-element :id="item.id" v-bind="navElement(item)" :class="[{'icon-loading-small': item.loading, 'open': item.opened, 'collapsible': item.collapsible&&item.children&&item.children.length>0 }, item.classes]"> <!-- Bullet --> @@ -64,7 +64,7 @@ <ul v-if="item.children"> <navigation-item v-for="(item, key) in item.children" :item="item" :key="key" /> </ul> - </router-link> + </nav-element> </template> <script> @@ -84,7 +84,7 @@ export default { data() { return { openedMenu: false - } + }; }, methods: { showMenu() { @@ -101,12 +101,29 @@ export default { cancelEdit() { // remove the editing class if (Array.isArray(this.item.classes)) - this.item.classes = this.item.classes.filter(item => item !== 'editing'); + this.item.classes = this.item.classes.filter( + item => item !== 'editing' + ); + }, + // This is used to decide which outter element type to use + // li or router-link + navElement(item) { + if (item.href) { + return { + is: 'li' + }; + } + return { + is: 'router-link', + tag: 'li', + to: item.router, + exact: true + }; } }, mounted() { // prevent click outside event with popupItem. this.popupItem = this.$el; - }, -} + } +}; </script> diff --git a/settings/src/views/Users.vue b/settings/src/views/Users.vue index 67b960cba5f..d7b55033c77 100644 --- a/settings/src/views/Users.vue +++ b/settings/src/views/Users.vue @@ -233,7 +233,6 @@ export default { groups = groups.map(group => { let item = {}; item.id = group.id.replace(' ', '_'); - item.classes = []; // empty classes, active will be set later item.router = { // router link to name: 'group', params: {selectedGroup: group.id} @@ -270,7 +269,6 @@ export default { // Add everyone group groups.unshift({ id: 'everyone', - classes: [], router: {name:'users'}, text: t('settings', 'Everyone'), utils: {counter: this.userCount} |