Merge pull request #2021 from nextcloud/bugfix/noid/description
This commit is contained in:
@@ -132,11 +132,6 @@
|
|||||||
href="https://deck.readthedocs.io/en/latest/Markdown/"
|
href="https://deck.readthedocs.io/en/latest/Markdown/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="icon icon-info" />
|
class="icon icon-info" />
|
||||||
<Actions v-if="canEdit">
|
|
||||||
<ActionButton v-if="descriptionEditing" icon="icon-attach" @click="showAttachmentModal()">
|
|
||||||
{{ t('deck', 'Add Attachment') }}
|
|
||||||
</ActionButton>
|
|
||||||
</Actions>
|
|
||||||
<Actions v-if="canEdit">
|
<Actions v-if="canEdit">
|
||||||
<ActionButton v-if="!descriptionEditing" icon="icon-rename" @click="showEditor()">
|
<ActionButton v-if="!descriptionEditing" icon="icon-rename" @click="showEditor()">
|
||||||
{{ t('deck', 'Edit description') }}
|
{{ t('deck', 'Edit description') }}
|
||||||
@@ -145,6 +140,11 @@
|
|||||||
{{ t('deck', 'View description') }}
|
{{ t('deck', 'View description') }}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
</Actions>
|
</Actions>
|
||||||
|
<Actions v-if="canEdit">
|
||||||
|
<ActionButton v-if="descriptionEditing" icon="icon-attach" @click="showAttachmentModal()">
|
||||||
|
{{ t('deck', 'Add Attachment') }}
|
||||||
|
</ActionButton>
|
||||||
|
</Actions>
|
||||||
</h5>
|
</h5>
|
||||||
|
|
||||||
<div v-if="!descriptionEditing"
|
<div v-if="!descriptionEditing"
|
||||||
@@ -152,10 +152,12 @@
|
|||||||
@click="clickedPreview"
|
@click="clickedPreview"
|
||||||
v-html="renderedDescription" />
|
v-html="renderedDescription" />
|
||||||
<VueEasymde v-else
|
<VueEasymde v-else
|
||||||
|
:key="copiedCard.id"
|
||||||
ref="markdownEditor"
|
ref="markdownEditor"
|
||||||
:value="copiedCard.description"
|
v-model="copiedCard.description"
|
||||||
:configs="mdeConfig"
|
:configs="mdeConfig"
|
||||||
@input="updateDescription" />
|
@input="updateDescription"
|
||||||
|
@blur="saveDescription" />
|
||||||
</AppSidebarTab>
|
</AppSidebarTab>
|
||||||
|
|
||||||
<AppSidebarTab id="attachments"
|
<AppSidebarTab id="attachments"
|
||||||
@@ -356,11 +358,15 @@ export default {
|
|||||||
this.initialize()
|
this.initialize()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initialize() {
|
async initialize() {
|
||||||
if (!this.currentCard) {
|
if (!this.currentCard) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.copiedCard) {
|
||||||
|
await this.saveDescription()
|
||||||
|
}
|
||||||
|
|
||||||
this.copiedCard = JSON.parse(JSON.stringify(this.currentCard))
|
this.copiedCard = JSON.parse(JSON.stringify(this.currentCard))
|
||||||
this.allLabels = this.currentCard.labels
|
this.allLabels = this.currentCard.labels
|
||||||
|
|
||||||
@@ -431,20 +437,21 @@ export default {
|
|||||||
this.copiedCard.duedate = null
|
this.copiedCard.duedate = null
|
||||||
this.$store.dispatch('updateCardDue', this.copiedCard)
|
this.$store.dispatch('updateCardDue', this.copiedCard)
|
||||||
},
|
},
|
||||||
|
async saveDescription() {
|
||||||
|
if (!Object.prototype.hasOwnProperty.call(this.copiedCard, 'descriptionLastEdit') || this.descriptionSaving) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.descriptionSaving = true
|
||||||
|
await this.$store.dispatch('updateCardDesc', this.copiedCard)
|
||||||
|
delete this.copiedCard.descriptionLastEdit
|
||||||
|
this.descriptionSaving = false
|
||||||
|
},
|
||||||
updateDescription(text) {
|
updateDescription(text) {
|
||||||
this.copiedCard.description = text
|
|
||||||
this.copiedCard.descriptionLastEdit = Date.now()
|
this.copiedCard.descriptionLastEdit = Date.now()
|
||||||
clearTimeout(this.descriptionSaveTimeout)
|
clearTimeout(this.descriptionSaveTimeout)
|
||||||
this.descriptionSaveTimeout = setTimeout(async() => {
|
this.descriptionSaveTimeout = setTimeout(async() => {
|
||||||
if (!Object.prototype.hasOwnProperty.call(this.copiedCard, 'descriptionLastEdit') || this.descriptionSaving) {
|
await this.saveDescription()
|
||||||
return
|
|
||||||
}
|
|
||||||
this.descriptionSaving = true
|
|
||||||
await this.$store.dispatch('updateCardDesc', this.copiedCard)
|
|
||||||
delete this.copiedCard.descriptionLastEdit
|
|
||||||
this.descriptionSaving = false
|
|
||||||
}, 2500)
|
}, 2500)
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
closeSidebar() {
|
closeSidebar() {
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ module.exports = {
|
|||||||
filename: '[name].js',
|
filename: '[name].js',
|
||||||
path: __dirname + '/js',
|
path: __dirname + '/js',
|
||||||
publicPath: '/js/',
|
publicPath: '/js/',
|
||||||
jsonpFunction: 'webpackJsonpOCADeck'
|
jsonpFunction: 'webpackJsonpOCADeck',
|
||||||
|
chunkFilename: '[name].js?v=[contenthash]',
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
|
|||||||
Reference in New Issue
Block a user