pinafore/routes/_components/compose/ComposeToolbar.html

49 lines
1.3 KiB
HTML
Raw Normal View History

2018-02-27 05:50:03 +00:00
<div class="compose-box-toolbar">
2018-02-28 07:18:07 +00:00
<IconButton
label="Insert emoji"
href="#fa-smile"
on:click="onEmojiClick()"
/>
2018-03-01 17:02:42 +00:00
<IconButton label="Add media"
href="#fa-camera"
on:click="onMediaClick()"
/>
<input ref:input
style="display: none;"
type="file"
accept=".jpg,.jpeg,.png,.gif,.webm,.mp4,.m4v,image/jpeg,image/png,image/gif,video/webm,video/mp4">
2018-02-27 05:50:03 +00:00
<IconButton label="Adjust privacy" href="#fa-globe" />
<IconButton label="Add content warning" href="#fa-exclamation-triangle" />
</div>
<style>
.compose-box-toolbar {
grid-area: toolbar;
align-self: center;
display: flex;
align-items: center;
}
</style>
<script>
import IconButton from '../IconButton.html'
2018-02-28 07:18:07 +00:00
import { store } from '../../_store/store'
import { updateCustomEmojiForInstance } from '../../_actions/emoji'
import { importDialogs } from '../../_utils/asyncModules'
2018-02-27 05:50:03 +00:00
export default {
components: {
IconButton
2018-02-28 07:18:07 +00:00
},
store: () => store,
methods: {
async onEmojiClick() {
/* no await */ updateCustomEmojiForInstance(this.store.get('currentInstance'))
let dialogs = await importDialogs()
dialogs.showEmojiDialog()
2018-03-01 17:02:42 +00:00
},
onMediaClick() {
this.refs.input.click()
2018-02-28 07:18:07 +00:00
}
2018-02-27 05:50:03 +00:00
}
2018-03-01 17:02:42 +00:00
2018-02-27 05:50:03 +00:00
}
</script>