BigW Consortium Gitlab

Commit fd467c93 by Alfredo Sumaran

Fix click event handling

parent 41203686
...@@ -15,12 +15,21 @@ export default { ...@@ -15,12 +15,21 @@ export default {
}, },
}, },
methods: { methods: {
toggleSubGroups(e) { onClickRowGroup(e) {
if (e.target.tagName === 'A' || !this.group.hasSubgroups) { // e.stopPropagation();
return false;
// 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) { onLeaveGroup(e) {
e.preventDefault(); e.preventDefault();
...@@ -28,6 +37,8 @@ export default { ...@@ -28,6 +37,8 @@ export default {
if (confirm(`Are you sure you want to leave the "${this.group.fullName}" group?`)) { if (confirm(`Are you sure you want to leave the "${this.group.fullName}" group?`)) {
this.leaveGroup(); this.leaveGroup();
} }
return false;
}, },
leaveGroup() { leaveGroup() {
eventHub.$emit('leaveGroup', this.group.leavePath); eventHub.$emit('leaveGroup', this.group.leavePath);
...@@ -76,7 +87,7 @@ export default { ...@@ -76,7 +87,7 @@ export default {
<template> <template>
<li <li
@click.stop="toggleSubGroups" @click.stop="onClickRowGroup"
:id="groupDomId" :id="groupDomId"
:class="rowClass" :class="rowClass"
> >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment