commit: 8a58de5c9fd7b275df2c79eafa8260a9e1fb706e
parent fb8747729850a683995efc0c9823455b13e37e66
Author: tusooa <tusooa@kazv.moe>
Date: Thu, 6 Apr 2023 14:25:19 -0400
Allow confirmation on closing edit form
Diffstat:
4 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/components/edit_status_form/edit_status_form.js b/src/components/edit_status_form/edit_status_form.js
@@ -12,6 +12,9 @@ const EditStatusForm = {
}
},
methods: {
+ requestClose () {
+ this.$refs.postStatusForm.requestClose()
+ },
doEditStatus ({ status, spoilerText, sensitive, media, contentType, poll }) {
const params = {
store: this.$store,
diff --git a/src/components/edit_status_form/edit_status_form.vue b/src/components/edit_status_form/edit_status_form.vue
@@ -1,5 +1,6 @@
<template>
<PostStatusForm
+ ref="postStatusForm"
v-bind="params"
:post-handler="doEditStatus"
:disable-polls="true"
diff --git a/src/components/edit_status_modal/edit_status_modal.js b/src/components/edit_status_modal/edit_status_modal.js
@@ -43,6 +43,9 @@ const EditStatusModal = {
},
methods: {
closeModal () {
+ this.$refs.editStatusForm.requestClose()
+ },
+ doCloseModal () {
this.$store.dispatch('closeEditStatusModal')
}
}
diff --git a/src/components/edit_status_modal/edit_status_modal.vue b/src/components/edit_status_modal/edit_status_modal.vue
@@ -9,9 +9,11 @@
{{ $t('post_status.edit_status') }}
</div>
<EditStatusForm
+ ref="editStatusForm"
class="panel-body"
:params="params"
- @posted="closeModal"
+ @posted="doCloseModal"
+ @can-close="doCloseModal"
/>
</div>
</Modal>