2018-04-05 03:33:17 +00:00
|
|
|
<ModalDialog
|
|
|
|
:label
|
|
|
|
:shown
|
|
|
|
:closed
|
|
|
|
:title
|
|
|
|
background="var(--main-bg)"
|
|
|
|
on:destroyDialog="destroy()"
|
|
|
|
>
|
2018-04-08 22:08:32 +00:00
|
|
|
<ComposeBox realm="dialog" size="slim" autoFocus="true" />
|
2018-03-27 07:02:55 +00:00
|
|
|
</ModalDialog>
|
|
|
|
<script>
|
|
|
|
import ModalDialog from './ModalDialog.html'
|
|
|
|
import ComposeBox from '../compose/ComposeBox.html'
|
2018-04-08 22:08:32 +00:00
|
|
|
import { on } from '../../_utils/eventBus'
|
2018-03-27 07:02:55 +00:00
|
|
|
|
|
|
|
export default {
|
2018-04-08 22:08:32 +00:00
|
|
|
oncreate() {
|
|
|
|
on('postedStatus', this, this.onPostedStatus)
|
|
|
|
},
|
2018-03-27 07:02:55 +00:00
|
|
|
components: {
|
|
|
|
ModalDialog,
|
|
|
|
ComposeBox
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async show() {
|
|
|
|
this.set({shown: true})
|
|
|
|
},
|
2018-04-08 22:08:32 +00:00
|
|
|
onPostedStatus(realm) {
|
|
|
|
if (realm !== 'dialog') {
|
|
|
|
return
|
|
|
|
}
|
2018-04-06 15:49:15 +00:00
|
|
|
try {
|
|
|
|
this.set({closed: true})
|
|
|
|
} catch (e) {
|
|
|
|
// TODO: this seems to error sometimes, not sure why
|
|
|
|
console.error(e)
|
|
|
|
}
|
2018-03-27 07:02:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|