diff --git a/app/assets/javascripts/issue_show/components/app.vue b/app/assets/javascripts/issue_show/components/app.vue index a9418dd0bb2..5c253bfd0c1 100644 --- a/app/assets/javascripts/issue_show/components/app.vue +++ b/app/assets/javascripts/issue_show/components/app.vue @@ -57,8 +57,14 @@ export default { store, state: store.state, formState: store.formState, + showForm: false, }; }, + computed: { + elementType() { + return this.showForm ? 'form' : 'div'; + }, + }, components: { descriptionComponent, titleComponent, @@ -90,6 +96,14 @@ export default { }); }, }, + methods: { + openForm() { + this.showForm = true; + this.store.formState = { + title: this.state.titleText, + }; + }, + }, created() { this.service = new Service(this.endpoint); this.poll = new Poll({ @@ -117,17 +131,21 @@ export default { eventHub.$on('delete.issuable', this.deleteIssuable); eventHub.$on('update.issuable', this.updateIssuable); + eventHub.$on('open.form', this.openForm); }, beforeDestroy() { eventHub.$off('delete.issuable', this.deleteIssuable); eventHub.$off('update.issuable', this.updateIssuable); + eventHub.$on('open.form', this.openForm); }, };