feat: Add cmd/ctrl click open on the conversation cards (#7100)

This commit is contained in:
Pranav Raj S
2023-05-16 16:57:25 -07:00
committed by GitHub
parent db0d32f01d
commit 49ef4e54ca

View File

@@ -9,7 +9,7 @@
}" }"
@mouseenter="onCardHover" @mouseenter="onCardHover"
@mouseleave="onCardLeave" @mouseleave="onCardLeave"
@click="cardClick(chat)" @click="onCardClick"
@contextmenu="openContextMenu($event)" @contextmenu="openContextMenu($event)"
> >
<label v-if="hovered || selected" class="checkbox-wrapper" @click.stop> <label v-if="hovered || selected" class="checkbox-wrapper" @click.stop>
@@ -313,21 +313,33 @@ export default {
}, },
}, },
methods: { methods: {
cardClick(chat) { onCardClick(e) {
const { activeInbox } = this; const { activeInbox, chat } = this;
const path = conversationUrl({ const path = frontendURL(
accountId: this.accountId, conversationUrl({
activeInbox, accountId: this.accountId,
id: chat.id, activeInbox,
label: this.activeLabel, id: chat.id,
teamId: this.teamId, label: this.activeLabel,
foldersId: this.foldersId, teamId: this.teamId,
conversationType: this.conversationType, foldersId: this.foldersId,
}); conversationType: this.conversationType,
})
);
if (e.metaKey || e.ctrlKey) {
window.open(
window.chatwootConfig.hostURL + path,
'_blank',
'noopener noreferrer nofollow'
);
return;
}
if (this.isActiveChat) { if (this.isActiveChat) {
return; return;
} }
router.push({ path: frontendURL(path) });
router.push({ path });
}, },
onCardHover() { onCardHover() {
this.hovered = !this.hideThumbnail; this.hovered = !this.hideThumbnail;