From b6383fe0908646bdc62d01dcf2fb04056a7ec245 Mon Sep 17 00:00:00 2001 From: Richard Steinmetz Date: Wed, 20 Mar 2024 10:18:23 +0100 Subject: [PATCH] fix(editor): show placeholder if an event's title is empty Signed-off-by: Richard Steinmetz --- src/views/EditSimple.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/views/EditSimple.vue b/src/views/EditSimple.vue index d5b3de6bb..535d1a095 100644 --- a/src/views/EditSimple.vue +++ b/src/views/EditSimple.vue @@ -103,7 +103,7 @@ :is-read-only="isReadOnlyOrViewing || !canModifyCalendar" @update:value="changeCalendar" /> - @@ -262,6 +262,19 @@ export default { isReadOnlyOrViewing() { return this.isReadOnly || this.isViewing || this.isWidget }, + + /** + * Return the event's title or a placeholder if it is empty + * + * @return {string} + */ + titleOrPlaceholder() { + if (this.title === '' && this.isReadOnlyOrViewing && !this.isLoading) { + return t('calendar', 'Untitled event') + } + + return this.title + } }, watch: { $route(to, from) {