diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-11-12 18:44:08 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-11-12 18:44:08 +0100 |
| commit | e9e753640f1c96ffaf91b35cfc46126fcdb15e2f (patch) | |
| tree | 8a17d25104006bf8cc75434903cea1455dd585ec /animism-align/frontend/app/views/viewer/viewer.actions.js | |
| parent | 787da7d6fc4c83196beeab23b1bcb7ca393cbb72 (diff) | |
better control over cover image
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/viewer.actions.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js index fa63804..82d3cf1 100644 --- a/animism-align/frontend/app/views/viewer/viewer.actions.js +++ b/animism-align/frontend/app/views/viewer/viewer.actions.js @@ -192,8 +192,13 @@ export const loadSections = () => dispatch => { // currentSection.fullscreenTimeline.unshift(initial_curtain_event) } - if (currentSection.fullscreenTimeline.length && currentSection.fullscreenTimeline[0].type === 'curtain' && currentSection.media.length) { - currentSection.fullscreenTimeline[0].mediaItem = currentSection.media[0].media + if (currentSection.fullscreenTimeline.length && currentSection.fullscreenTimeline[0].type === 'curtain') { + if (currentSection.cover_id) { + currentSection.fullscreenTimeline[0].mediaItem = mediaLookup[currentSection.cover_id] + } else if (currentSection.media.length) { + currentSection.fullscreenTimeline[0].mediaItem = currentSection.media[0].media + } + currentSection.fullscreenTimeline[0].cover_style = currentSection.cover_style } currentSection.duration = currentSection.end_ts - currentSection.start_ts currentSection.inlineParagraphCount = currentSection.paragraphs.filter(p => !p.hidden).length @@ -209,6 +214,8 @@ const newSection = (annotation, index, mediaIndex) => ({ start_ts: annotation.start_ts, end_ts: 0, title: annotation.text, + cover_id: annotation.settings.media_id || 0, + cover_style: annotation.settings.cover_style || "cover", media: [], fullscreenTimeline: [], index, |
