Make title editable in the sidebar

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2020-08-29 11:06:49 +02:00
parent acc600e807
commit 3e2e7c1216

View File

@@ -24,6 +24,8 @@
<AppSidebar v-if="currentBoard && currentCard && copiedCard"
:title="currentCard.title"
:subtitle="subtitle"
:title-editable.sync="titleEditable"
@update:title="updateTitle"
@close="closeSidebar">
<template #secondary-actions />
<AppSidebarTab id="details"
@@ -253,6 +255,7 @@ export default {
saving: false,
markdownIt: null,
titleEditable: false,
descriptionEditing: false,
mdeConfig: {
autoDownloadFontAwesome: false,
@@ -434,6 +437,12 @@ export default {
delete this.copiedCard.descriptionLastEdit
this.descriptionSaving = false
},
updateTitle(newTitle) {
this.$set(this.copiedCard, 'title', newTitle)
this.$store.dispatch('updateCardTitle', this.copiedCard).then(() => {
this.titleEditable = false
})
},
updateDescription() {
this.copiedCard.descriptionLastEdit = Date.now()
clearTimeout(this.descriptionSaveTimeout)