fix(frontend): 노트 작성 폼에서 답글 또는 인용 대상 노트를 클릭할 수 있음
This commit is contained in:
parent
4ebbf4ad19
commit
467d2274f0
|
@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
-->
|
||||
|
||||
<template>
|
||||
<div :class="$style.root" :style="{ cursor: expandOnNoteClick ? 'pointer' : '' }" @click.stop="noteClick">
|
||||
<div :class="$style.root" :style="{ cursor: expandOnNoteClick && enableNoteClick ? 'pointer' : '' }" @click.stop="noteClick">
|
||||
<div style="display: flex; padding-bottom: 10px;">
|
||||
<MkAvatar v-if="!defaultStore.state.hideAvatarsInNote" :class="[$style.avatar, { [$style.showEl]: (showEl && ['hideHeaderOnly', 'hideHeaderFloatBtn', 'hide'].includes(<string>defaultStore.state.displayHeaderNavBarWhenScroll)) && mainRouter.currentRoute.value.name === 'index', [$style.showElTab]: (showEl && ['hideHeaderOnly', 'hideHeaderFloatBtn', 'hide'].includes(<string>defaultStore.state.displayHeaderNavBarWhenScroll)) && mainRouter.currentRoute.value.name !== 'index' }]" :user="note.user" link preview/>
|
||||
<div :class="$style.main">
|
||||
|
@ -36,9 +36,12 @@ import { mainRouter, useRouter } from '@/router.js';
|
|||
import { defaultStore } from '@/store.js';
|
||||
import { notePage } from '@/filters/note.js';
|
||||
|
||||
const props = defineProps<{
|
||||
const props = withDefaults(defineProps<{
|
||||
note: Misskey.entities.Note;
|
||||
}>();
|
||||
enableNoteClick?: boolean,
|
||||
}>(), {
|
||||
enableNoteClick: true,
|
||||
});
|
||||
|
||||
const showEl = ref(false);
|
||||
|
||||
|
@ -53,7 +56,7 @@ onMounted(() => {
|
|||
});
|
||||
|
||||
function noteClick(ev: MouseEvent) {
|
||||
if (document.getSelection().type === 'Range' || !expandOnNoteClick) ev.stopPropagation();
|
||||
if (document.getSelection().type === 'Range' || !expandOnNoteClick || !props.enableNoteClick) ev.stopPropagation();
|
||||
else router.push(notePage(props.note));
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -52,8 +52,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</button>
|
||||
</div>
|
||||
</header>
|
||||
<MkNoteSimple v-if="reply" :class="$style.targetNote" :note="reply"/>
|
||||
<MkNoteSimple v-if="renote" :class="$style.targetNote" :note="renote"/>
|
||||
<MkNoteSimple v-if="reply" :class="$style.targetNote" :note="reply" :enableNoteClick="false"/>
|
||||
<MkNoteSimple v-if="renote" :class="$style.targetNote" :note="renote" :enableNoteClick="false"/>
|
||||
<div v-if="quoteId" :class="$style.withQuote"><i class="ti ti-quote"></i> {{ i18n.ts.quoteAttached }}<button @click="quoteId = null"><i class="ti ti-x"></i></button></div>
|
||||
<MkEventEditor v-if="event" v-model="event" @destroyed="event = null"/>
|
||||
<div v-if="visibility === 'specified'" :class="$style.toSpecified">
|
||||
|
|
Loading…
Reference in a new issue