mirror of https://github.com/nextcloud/calendar
fix(editor): show placeholder if an event's title is empty
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
This commit is contained in:
parent
59fe5d0cac
commit
b6383fe090
|
@ -103,7 +103,7 @@
|
||||||
:is-read-only="isReadOnlyOrViewing || !canModifyCalendar"
|
:is-read-only="isReadOnlyOrViewing || !canModifyCalendar"
|
||||||
@update:value="changeCalendar" />
|
@update:value="changeCalendar" />
|
||||||
|
|
||||||
<PropertyTitle :value="title"
|
<PropertyTitle :value="titleOrPlaceholder"
|
||||||
:is-read-only="isReadOnlyOrViewing"
|
:is-read-only="isReadOnlyOrViewing"
|
||||||
@update:value="updateTitle" />
|
@update:value="updateTitle" />
|
||||||
|
|
||||||
|
@ -262,6 +262,19 @@ export default {
|
||||||
isReadOnlyOrViewing() {
|
isReadOnlyOrViewing() {
|
||||||
return this.isReadOnly || this.isViewing || this.isWidget
|
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: {
|
watch: {
|
||||||
$route(to, from) {
|
$route(to, from) {
|
||||||
|
|
Loading…
Reference in New Issue