pinafore/src/routes/_components/dialog/components/ComposeDialog.html

41 lines
884 B
HTML

<ModalDialog
{id}
{label}
{title}
background="var(--main-bg)"
>
<ComposeBox realm="dialog" autoFocus="true" />
</ModalDialog>
<script>
import ModalDialog from './ModalDialog.html'
import ComposeBox from '../../compose/ComposeBox.html'
import { on } from '../../../_utils/eventBus'
import { show } from '../helpers/showDialog'
import { oncreate as onCreateDialog } from '../helpers/onCreateDialog'
import { close } from '../helpers/closeDialog'
export default {
oncreate () {
on('postedStatus', this, this.onPostedStatus)
onCreateDialog.call(this)
},
data: () => ({
title: void 0
}),
methods: {
show,
close,
onPostedStatus (realm) {
if (realm !== 'dialog') {
return
}
this.close()
}
},
components: {
ModalDialog,
ComposeBox
}
}
</script>