pinafore/routes/_components/dialog/components/AccountProfileOptionsDialog.html

54 lines
1.2 KiB
HTML
Raw Normal View History

2018-04-05 04:45:19 +00:00
<ModalDialog
:id
2018-04-05 04:45:19 +00:00
:label
:title
background="var(--main-bg)"
>
<GenericDialogList :items on:click="onClick(event)"/>
</ModalDialog>
<script>
import ModalDialog from './ModalDialog.html'
import { store } from '../../../_store/store'
2018-04-05 04:45:19 +00:00
import GenericDialogList from './GenericDialogList.html'
import { importDialogs } from '../../../_utils/asyncModules'
import { createDialogId } from '../helpers/createDialogId'
import { show } from '../helpers/showDialog'
import { close } from '../helpers/closeDialog'
import { oncreate } from '../helpers/onCreateDialog'
2018-04-05 04:45:19 +00:00
export default {
oncreate,
store: () => store,
data: () => ({
id: createDialogId()
}),
2018-04-05 04:45:19 +00:00
computed: {
items: (account) => (
[
{
key: 'mention',
label: 'Mention @' + (account.acct),
icon: '#fa-comments'
}
]
)
},
methods: {
show,
close,
2018-04-07 07:21:00 +00:00
async onClick() {
2018-04-05 04:45:19 +00:00
let account = this.get('account')
2018-04-07 07:21:00 +00:00
this.store.setComposeData('dialog', {
2018-04-05 04:45:19 +00:00
text: `@${account.acct} `
})
2018-04-07 07:21:00 +00:00
let dialogs = await importDialogs()
dialogs.showComposeDialog()
this.close()
2018-04-05 04:45:19 +00:00
}
},
components: {
ModalDialog,
GenericDialogList
},
2018-04-05 04:45:19 +00:00
}
</script>