From ad6ef6856f247f87b7f1efa424c6846b27111ca1 Mon Sep 17 00:00:00 2001 From: fly_mc Date: Fri, 18 Oct 2024 12:05:42 +0800 Subject: [PATCH] MkNote DblClick to expand --- packages/frontend/src/components/MkNote.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index cf6ba6ae3..bf00d3ce5 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -45,7 +45,7 @@ SPDX-License-Identifier: AGPL-3.0-only -
+
@@ -220,6 +220,8 @@ import { type Keymap } from '@/scripts/hotkey.js'; import { focusPrev, focusNext } from '@/scripts/focus.js'; import { getAppearNote } from '@/scripts/get-appear-note.js'; import { miLocalStorage } from '@/local-storage.js'; +import { useRouter } from '@/router/supplier.js'; +import { notePage } from '@/filters/note.js'; import detectLanguage from '@/scripts/detect-language.js'; const props = withDefaults(defineProps<{ @@ -287,6 +289,7 @@ const translation = ref(null); const translating = ref(false); const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.value.user.instance); const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || (appearNote.value.visibility === 'followers' && appearNote.value.userId === $i?.id)); +const router = useRouter(); const renoteCollapsed = ref( defaultStore.state.collapseRenotes && isRenote && ( ($i && ($i.id === note.value.userId || $i.id === appearNote.value.userId)) || // `||` must be `||`! See https://github.com/misskey-dev/misskey/issues/13131 @@ -431,6 +434,11 @@ if (!props.mock) { } } +function noteDblClick(ev: MouseEvent) { + if (window.getSelection()?.toString() !== '') ev.stopPropagation(); + else router.push(notePage(appearNote.value)); +} + function renote(viaKeyboard = false) { pleaseLogin(undefined, pleaseLoginContext.value); showMovedDialog();