diff --git a/components/status/StatusCard.vue b/components/status/StatusCard.vue index c6fabb94..88a9a6d3 100644 --- a/components/status/StatusCard.vue +++ b/components/status/StatusCard.vue @@ -21,16 +21,22 @@ const rebloggedBy = $computed(() => props.status.reblog ? props.status.account : const el = ref() const router = useRouter() -function onclick(e: MouseEvent | KeyboardEvent) { - const path = e.composedPath() as HTMLElement[] +function onclick(evt: MouseEvent | KeyboardEvent) { + const path = evt.composedPath() as HTMLElement[] const el = path.find(el => ['A', 'BUTTON', 'IMG', 'VIDEO'].includes(el.tagName?.toUpperCase())) if (!el) - go() + go(evt) } -function go() { - cacheStatus(status) - router.push(getStatusPath(status)) +function go(evt: MouseEvent | KeyboardEvent) { + const path = getStatusPath(status) + if (evt.metaKey || evt.ctrlKey) { + window.open(path) + } + else { + cacheStatus(status) + router.push(path) + } } const createdAt = useFormattedDateTime(status.createdAt) @@ -62,7 +68,7 @@ const timeago = useTimeAgo(() => status.createdAt, timeAgoOptions)
- +