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.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js
index f251e08..6645e44 100644
--- a/animism-align/frontend/app/views/viewer/viewer.actions.js
+++ b/animism-align/frontend/app/views/viewer/viewer.actions.js
@@ -251,6 +251,12 @@ export const toggleNavComponent = key => dispatch => {
}
export const toggleComponent = key => dispatch => {
+ hideNavElementsNotMatchedBy(key)(dispatch)
+ const state = store.getState().viewer
+ dispatch({ type: types.viewer.toggle_component, key, value: !state[key] })
+}
+
+export const hideNavElementsNotMatchedBy = key => dispatch => {
const state = store.getState().viewer
if (key !== "share" && state.share) {
dispatch({ type: types.viewer.toggle_component, key: "share", value: false })
@@ -261,7 +267,6 @@ export const toggleComponent = key => dispatch => {
if (key !== "subscribe" && state.subscribe) {
dispatch({ type: types.viewer.toggle_component, key: "subscribe", value: false })
}
- dispatch({ type: types.viewer.toggle_component, key, value: !state[key] })
}
export const openTranscript = () => dispatch => {
@@ -342,6 +347,15 @@ export const setSectionFromTimestamp = play_ts => dispatch => {
}
}
+/* footnotes */
+
+export const openFootnote = (annotation) => dispatch => {
+ console.log(annotation)
+ dispatch({ type: types.viewer.open_footnote, footnote_id: annotation.footnote_id })
+ hideNavElementsNotMatchedBy('footnotes')(dispatch)
+ showComponent('footnotes')(dispatch)
+}
+
/* vitrine modal */
export const openVitrineModal = (media, color, id) => dispatch => {