pinafore/src/routes/_components/dialog/components/ComposeDialog.html
Nolan Lawson 1712081f0b
fix: fix profile clicks from compose dialog (#1160)
* fix: don't allow profile clicks from compose dialog

fixes #1159

* make the links work correctly in the modal

* fix tests
2019-04-20 09:12:30 -07:00

40 lines
898 B
HTML

<ModalDialog
{id}
{label}
{title}
background="var(--main-bg)"
>
<ComposeBox realm="dialog" autoFocus={true} dialogId={id} />
</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>