summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/viewer.actions.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-09-09 18:55:59 +0200
committerJules Laplace <julescarbon@gmail.com>2020-09-09 18:55:59 +0200
commitaf17cb4e5de2d236305c208de9c4bc16efdc04b8 (patch)
tree10ffeaa0bb28d8891004a0c10a8325a425cef4b1 /animism-align/frontend/app/views/viewer/viewer.actions.js
parent8bc34e487d138573374c4cbe2fe6e892565b9323 (diff)
keep track of carousel advance instructions
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
-rw-r--r--animism-align/frontend/app/views/viewer/viewer.actions.js13
1 files changed, 11 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 5d10f2a..2771957 100644
--- a/animism-align/frontend/app/views/viewer/viewer.actions.js
+++ b/animism-align/frontend/app/views/viewer/viewer.actions.js
@@ -6,7 +6,9 @@ import {
TEXT_ANNOTATION_TYPES,
INLINE_UTILITY_ANNOTATION_TYPES,
FULLSCREEN_UTILITY_ANNOTATION_TYPES,
- CURTAIN_COLOR_LOOKUP, GROWL,
+ GALLERY_UTILITY_ANNOTATION_TYPES,
+ CURTAIN_COLOR_LOOKUP,
+ GROWL,
} from 'app/constants'
import { floatInRange } from 'app/utils'
import { buildParagraphs } from 'app/utils/transcript.utils'
@@ -89,7 +91,7 @@ export const loadSections = () => dispatch => {
if (!media.settings.hide_in_bibliography && !(media.id in seenMedia)) {
currentSection.media.push({
start_ts: annotation.start_ts,
- media
+ media,
})
seenMedia[media.id] = true
}
@@ -109,6 +111,13 @@ export const loadSections = () => dispatch => {
}
}
+ // build timeline of gallery / carousel advance instructions
+ if (GALLERY_UTILITY_ANNOTATION_TYPES.has(annotation.type) && currentSection.fullscreenTimeline.length) {
+ const lastTimelineEvent = currentSection.fullscreenTimeline[currentSection.fullscreenTimeline.length - 1]
+ if (!lastTimelineEvent.timeline) lastTimelineEvent.timeline = []
+ lastTimelineEvent.timeline.push(annotation)
+ }
+
// build timeline of special inline items
if (INLINE_UTILITY_ANNOTATION_TYPES.has(annotation.type)) {
sectionTextAnnotationOrder.push(annotation.id)