aboutsummaryrefslogtreecommitdiff
path: root/src/components/media_modal
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2021-06-18 02:01:37 +0300
committerHenry Jameson <me@hjkos.com>2021-06-18 02:03:38 +0300
commit90345f158ff2eb12e619dbd7406f2fa81c379637 (patch)
treedfb6525618c641cfe94b1b342de36e8a280c6cfb /src/components/media_modal
parente654fead23ebb457f81e8642c65e1f3e98ee0027 (diff)
gallery now supports flash, fixes for flash component. refactored media modal
Diffstat (limited to 'src/components/media_modal')
-rw-r--r--src/components/media_modal/media_modal.js8
-rw-r--r--src/components/media_modal/media_modal.vue7
2 files changed, 12 insertions, 3 deletions
diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js
index e7384c93..b6919366 100644
--- a/src/components/media_modal/media_modal.js
+++ b/src/components/media_modal/media_modal.js
@@ -3,6 +3,7 @@ import VideoAttachment from '../video_attachment/video_attachment.vue'
import Modal from '../modal/modal.vue'
import fileTypeService from '../../services/file_type/file_type.service.js'
import GestureService from '../../services/gesture_service/gesture_service'
+import Flash from 'src/components/flash/flash.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faChevronLeft,
@@ -18,7 +19,8 @@ const MediaModal = {
components: {
StillImage,
VideoAttachment,
- Modal
+ Modal,
+ Flash
},
computed: {
showing () {
@@ -67,13 +69,13 @@ const MediaModal = {
goPrev () {
if (this.canNavigate) {
const prevIndex = this.currentIndex === 0 ? this.media.length - 1 : (this.currentIndex - 1)
- this.$store.dispatch('setCurrent', this.media[prevIndex])
+ this.$store.dispatch('setCurrentMedia', this.media[prevIndex])
}
},
goNext () {
if (this.canNavigate) {
const nextIndex = this.currentIndex === this.media.length - 1 ? 0 : (this.currentIndex + 1)
- this.$store.dispatch('setCurrent', this.media[nextIndex])
+ this.$store.dispatch('setCurrentMedia', this.media[nextIndex])
}
},
handleKeyupEvent (e) {
diff --git a/src/components/media_modal/media_modal.vue b/src/components/media_modal/media_modal.vue
index 54bc5335..a578bc71 100644
--- a/src/components/media_modal/media_modal.vue
+++ b/src/components/media_modal/media_modal.vue
@@ -28,6 +28,13 @@
:title="currentMedia.description"
controls
/>
+ <Flash
+ v-if="type === 'flash'"
+ class="modal-image"
+ :src="currentMedia.url"
+ :alt="currentMedia.description"
+ :title="currentMedia.description"
+ />
<button
v-if="canNavigate"
:title="$t('media_modal.previous')"