From 891cc62e0d68c24e767f28ca4c89f3cd429a7edd Mon Sep 17 00:00:00 2001 From: TalonTheDragon Date: Mon, 22 May 2023 12:18:17 +0200 Subject: [PATCH] Emit event when cw is expanded --- packages/client/src/components/MkNote.vue | 76 +++++++------------ .../src/components/MkSubNoteContent.vue | 2 + 2 files changed, 30 insertions(+), 48 deletions(-) diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index cac0461b42..8e6eb0d109 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -18,79 +18,47 @@ {{ i18n.ts.featured }}
- {{ i18n.ts.pinnedNote }} + {{ i18n.ts.pinnedNote }}
-
-
+
- +
- +
- {{ - i18n.t("translatedFrom", { - x: translation.sourceLang, - }) - }}: + {{ + i18n.t("translatedFrom", { + x: translation.sourceLang, + }) + }}: - +
@@ -461,18 +429,30 @@ function readPromo() { isDeleted.value = true; } +let postIsExpanded = false; + +function setPostExpanded(val: boolean) { + postIsExpanded = val; +} + const accessibleLabel = computed(() => { let label = `${props.note.user.username}; `; if (props.note.renote) { label += `${i18n.t("renoted")} ${props.note.renote.user.username}; `; if (props.note.renote.cw) { label += `content warning: ${props.note.renote.cw}; `; + if (postIsExpanded) { + label += `${props.note.renote.text}; `; + } } else { label += `${props.note.renote.text}; `; } } else { if (props.note.cw) { label += `${i18n.t("cw")}: ${props.note.cw}; `; + if (postIsExpanded) { + label += `${props.note.text}; `; + } } else { label += `${props.note.text}; `; } diff --git a/packages/client/src/components/MkSubNoteContent.vue b/packages/client/src/components/MkSubNoteContent.vue index b162bca0b9..5a46a319c5 100644 --- a/packages/client/src/components/MkSubNoteContent.vue +++ b/packages/client/src/components/MkSubNoteContent.vue @@ -54,6 +54,7 @@ v-model="showContent" :note="note" v-on:keydown="focusFooter" + v-on:update:model-value="(val) => emit('expanded', val)" />
(); const cwButton = ref();