Allow confirmation on closing edit form

This commit is contained in:
tusooa 2023-04-06 14:25:19 -04:00
parent f2bdc1c563
commit c9cacc32a4
No known key found for this signature in database
GPG Key ID: 42AEC43D48433C51
4 changed files with 10 additions and 1 deletions

View File

@ -12,6 +12,9 @@ const EditStatusForm = {
} }
}, },
methods: { methods: {
requestClose () {
this.$refs.postStatusForm.requestClose()
},
doEditStatus ({ status, spoilerText, sensitive, media, contentType, poll }) { doEditStatus ({ status, spoilerText, sensitive, media, contentType, poll }) {
const params = { const params = {
store: this.$store, store: this.$store,

View File

@ -1,5 +1,6 @@
<template> <template>
<PostStatusForm <PostStatusForm
ref="postStatusForm"
v-bind="params" v-bind="params"
:post-handler="doEditStatus" :post-handler="doEditStatus"
:disable-polls="true" :disable-polls="true"

View File

@ -43,6 +43,9 @@ const EditStatusModal = {
}, },
methods: { methods: {
closeModal () { closeModal () {
this.$refs.editStatusForm.requestClose()
},
doCloseModal () {
this.$store.dispatch('closeEditStatusModal') this.$store.dispatch('closeEditStatusModal')
} }
} }

View File

@ -9,9 +9,11 @@
{{ $t('post_status.edit_status') }} {{ $t('post_status.edit_status') }}
</div> </div>
<EditStatusForm <EditStatusForm
ref="editStatusForm"
class="panel-body" class="panel-body"
:params="params" :params="params"
@posted="closeModal" @posted="doCloseModal"
@can-close="doCloseModal"
/> />
</div> </div>
</Modal> </Modal>