diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-11-02 18:56:04 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-11-02 18:56:04 +0100 |
| commit | c8425fab008f058cd8e15d93147191725709ee8a (patch) | |
| tree | f75ef39e5e6650f3fd005a853d143aa1fe37b49a /animism-align/frontend | |
| parent | 4e2121e9160b627415a31f628fa3f00711138375 (diff) | |
fullscreen images support galleries
Diffstat (limited to 'animism-align/frontend')
3 files changed, 12 insertions, 3 deletions
diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js index d3e981a..ae58db4 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js +++ b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.image.js @@ -9,6 +9,7 @@ export const AnnotationFormImage = ({ annotation, media, handleSettingsSelect, h if (!media.lookup) return <div /> const image_list_items = makeMediaItems(media, ['image', 'gallery']) const { gallery_items, thumbnail } = makeGalleryItems(annotation, media) + console.log(annotation) return ( <div className='options'> <Select diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationTypes/annotationTypes.image.js b/animism-align/frontend/app/views/align/components/annotations/annotationTypes/annotationTypes.image.js index 9dcd976..d0a573e 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotationTypes/annotationTypes.image.js +++ b/animism-align/frontend/app/views/align/components/annotations/annotationTypes/annotationTypes.image.js @@ -39,7 +39,7 @@ export const AnnotationImage = ({ y, annotation, media, timeline, selected, onCl <div> <i>{mediaItem.title}</i>{' - '}{mediaItem.author} {mediaItem.type === 'gallery' && ( - ' [Frame ' + (1 + annotation.settings.frame_index) + ']' + ' [Frame ' + (1 + parseInt(annotation.settings.frame_index)) + ']' )} </div> </div> diff --git a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.image.js b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.image.js index ead2591..a70cd1f 100644 --- a/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.image.js +++ b/animism-align/frontend/app/views/viewer/player/components.fullscreen/fullscreen.image.js @@ -11,8 +11,16 @@ export const FullscreenImage = ({ element, media, transitionDuration }) => { transitionDuration, } let url; - if (item.type === 'gallery' && item.settings.display_lookup[element.annotation.settings.frame_index]) { - url = item.settings.display_lookup[element.annotation.settings.frame_index].url + console.log(element, item) + if (item.type === 'gallery') { + const index = parseInt(element.settings.frame_index) + const frame_id = item.settings.image_order[index] + const frame = item.settings.display_lookup[frame_id] + if (!frame) { + console.error("Slide not found:", element.settings.frame_index) + return <div /> + } + url = frame.url } else { url = item.settings.display.url } |
