summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/viewer.actions.js
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
-rw-r--r--animism-align/frontend/app/views/viewer/viewer.actions.js18
1 files changed, 16 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 8c03a10..01f4232 100644
--- a/animism-align/frontend/app/views/viewer/viewer.actions.js
+++ b/animism-align/frontend/app/views/viewer/viewer.actions.js
@@ -1,5 +1,6 @@
import * as types from 'app/types'
import { store, history, dispatch } from 'app/store'
+import actions from 'app/actions'
import {
MEDIA_ANNOTATION_TYPES, MEDIA_LABEL_TYPES,
TEXT_ANNOTATION_TYPES,
@@ -150,8 +151,8 @@ const makeFullscreenEvent = (index, annotation) => {
return event
}
-export const setCurrentSection = section => dispatch => {
- dispatch({ type: types.viewer.set_current_section, section })
+export const setCurrentSection = (currentSection, nextSection) => dispatch => {
+ dispatch({ type: types.viewer.set_current_section, currentSection, nextSection })
}
export const setNavStyle = color => dispatch => {
@@ -169,3 +170,16 @@ export const hideComponent = key => dispatch => {
export const toggleComponent = key => dispatch => {
dispatch({ type: types.viewer.toggle_component, key, value: !store.getState().viewer[key] })
}
+
+export const seekToSection = section => dispatch => {
+ actions.audio.seek(section.start_ts)
+ actions.audio.play()
+ actions.viewer.hideComponent('nav')
+}
+
+export const seekToMediaItem = mediaItem => dispatch => {
+ actions.audio.seek(mediaItem.start_ts)
+ actions.audio.play()
+ actions.viewer.hideComponent('nav')
+ actions.viewer.hideComponent('checklist')
+}