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..c651bd008 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.bubble(0); // save instantly + } else { + this.isPreviewActive = false; + this.isEditActive = true; + } }, }, }