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

54 lines
1.2 KiB
HTML
Raw Normal View History

2018-04-05 06:45:19 +02:00
<ModalDialog
:id
2018-04-05 06:45:19 +02: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 06:45:19 +02: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 06:45:19 +02:00
export default {
oncreate,
store: () => store,
data: () => ({
id: createDialogId()
}),
2018-04-05 06:45:19 +02:00
computed: {
items: (account) => (
[
{
key: 'mention',
label: 'Mention @' + (account.acct),
icon: '#fa-comments'
}
]
)
},
methods: {
show,
close,
2018-04-07 09:21:00 +02:00
async onClick() {
2018-04-05 06:45:19 +02:00
let account = this.get('account')
2018-04-07 09:21:00 +02:00
this.store.setComposeData('dialog', {
2018-04-05 06:45:19 +02:00
text: `@${account.acct} `
})
2018-04-07 09:21:00 +02:00
let dialogs = await importDialogs()
dialogs.showComposeDialog()
this.close()
2018-04-05 06:45:19 +02:00
}
},
components: {
ModalDialog,
GenericDialogList
},
2018-04-05 06:45:19 +02:00
}
</script>