diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-08-07 22:59:03 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-08-07 22:59:03 +0200 |
| commit | 475638e617c5053aeb897d26bfba4c8d1975c614 (patch) | |
| tree | 28762550bf791983e49bd33ec909c79f30f8a09f /animism-align/frontend/app/views/viewer/viewer.actions.js | |
| parent | 51abc790cb4952456029db1132c0e8730618afcd (diff) | |
next button
Diffstat (limited to 'animism-align/frontend/app/views/viewer/viewer.actions.js')
| -rw-r--r-- | animism-align/frontend/app/views/viewer/viewer.actions.js | 18 |
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') +} |
