Move media_viewer module to store

This commit is contained in:
Sean King 2023-04-05 13:55:38 -06:00
commit c25cfe540b
No known key found for this signature in database
GPG key ID: 510C52BACD6E7257
8 changed files with 49 additions and 56 deletions

View file

@ -18,6 +18,7 @@ import {
faPencilAlt,
faAlignRight
} from '@fortawesome/free-solid-svg-icons'
import { useMediaViewerStore } from '../../stores/media_viewer'
library.add(
faFile,
@ -147,14 +148,14 @@ const Attachment = {
openModal (event) {
if (this.useModal) {
this.$emit('setMedia')
this.$store.dispatch('setCurrentMedia', this.attachment)
useMediaViewerStore().setCurrentMedia(this.attachment)
} else if (this.type === 'unknown') {
window.open(this.attachment.url)
}
},
openModalForce (event) {
this.$emit('setMedia')
this.$store.dispatch('setCurrentMedia', this.attachment)
useMediaViewerStore().setCurrentMedia(this.attachment)
},
onEdit (event) {
this.edit && this.edit(this.attachment, event)