mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-01 00:36:44 -06:00
MkNote DblClick to expand
This commit is contained in:
parent
7ab5d48614
commit
ad6ef6856f
1 changed files with 9 additions and 1 deletions
|
@ -45,7 +45,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkAvatar :class="$style.collapsedRenoteTargetAvatar" :user="appearNote.user" link preview/>
|
||||
<Mfm :text="getNoteSummary(appearNote)" :plain="true" :nowrap="true" :author="appearNote.user" :nyaize="'respect'" :class="$style.collapsedRenoteTargetText" @click.stop="renoteCollapsed = false"/>
|
||||
</div>
|
||||
<article v-else :class="$style.article" @contextmenu.stop="onContextmenu">
|
||||
<article v-else :class="$style.article" @dblclick.stop="noteDblClick" @contextmenu.stop="onContextmenu">
|
||||
<div style="display: flex; padding-bottom: 10px;">
|
||||
<div v-if="appearNote.channel" :class="$style.colorBar" :style="{ background: appearNote.channel.color }"></div>
|
||||
<MkAvatar :class="$style.avatar" :user="appearNote.user" :link="!mock" :preview="!mock"/>
|
||||
|
@ -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<Misskey.entities.NotesTranslateResponse | null>(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();
|
||||
|
|
Loading…
Reference in a new issue