diff --git a/cypress/integration/task/task.spec.js b/cypress/integration/task/task.spec.js index 8f8dbbe64..efa398553 100644 --- a/cypress/integration/task/task.spec.js +++ b/cypress/integration/task/task.spec.js @@ -165,7 +165,7 @@ describe('Task', () => { cy.get('.task-view .details.content.description .editor .vue-easymde .EasyMDEContainer .CodeMirror-scroll') .type('{selectall}New Description') cy.get('.task-view .details.content.description .editor a') - .contains('Preview') + .contains('Done') .click() cy.get('.task-view .details.content.description h3 span.is-small.has-text-success') diff --git a/src/components/input/editor.vue b/src/components/input/editor.vue index 2e44b8681..4c76b43f4 100644 --- a/src/components/input/editor.vue +++ b/src/components/input/editor.vue @@ -2,11 +2,9 @@
@@ -23,17 +21,15 @@
@@ -394,10 +390,16 @@ export default { this.bubble() this.renderPreview() }, - showPreview() { - this.isPreviewActive = true - this.isEditActive = false - this.renderPreview() + toggleEdit() { + if (this.isEditActive) { + this.isPreviewActive = true; + this.isEditActive = false; + this.renderPreview(); + this.$emit('change'); + } else { + this.isPreviewActive = false; + this.isEditActive = true; + } }, }, }