diff options
-rw-r--r-- | app/assets/javascripts/groups/components/group_item.vue | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/app/assets/javascripts/groups/components/group_item.vue b/app/assets/javascripts/groups/components/group_item.vue index f6238a01497..dbda3c6c365 100644 --- a/app/assets/javascripts/groups/components/group_item.vue +++ b/app/assets/javascripts/groups/components/group_item.vue @@ -15,12 +15,21 @@ export default { }, }, methods: { - toggleSubGroups(e) { - if (e.target.tagName === 'A' || !this.group.hasSubgroups) { - return false; + onClickRowGroup(e) { + // e.stopPropagation(); + + // Skip for buttons + if (e.target.tagName === 'A' || + (e.target.tagName === 'I' && e.target.parentElement.tagName === 'A')) { + } else { + if (this.group.hasSubgroups) { + eventHub.$emit('toggleSubGroups', this.group); + } else { + window.location.href = this.group.webUrl; + } } - return eventHub.$emit('toggleSubGroups', this.group); + return false; }, onLeaveGroup(e) { e.preventDefault(); @@ -28,6 +37,8 @@ export default { if (confirm(`Are you sure you want to leave the "${this.group.fullName}" group?`)) { this.leaveGroup(); } + + return false; }, leaveGroup() { eventHub.$emit('leaveGroup', this.group.leavePath); @@ -76,7 +87,7 @@ export default { <template> <li - @click.stop="toggleSubGroups" + @click.stop="onClickRowGroup" :id="groupDomId" :class="rowClass" > |