summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-08-24 14:46:52 +0200
committerJules Laplace <julescarbon@gmail.com>2020-08-24 14:46:52 +0200
commit9f57a7f41ac4a8d2526f2b169193010eb76023a2 (patch)
tree256a0d1e6335486bc31822779ab3e16f536c4f59 /animism-align/frontend/app
parent270c9d6ddf4c7e1a59e6e955226bfa6bbfe9a781 (diff)
adding rest of content
Diffstat (limited to 'animism-align/frontend/app')
-rw-r--r--animism-align/frontend/app/views/align/components/annotations/annotation.form.js6
-rw-r--r--animism-align/frontend/app/views/viewer/viewer.actions.js2
2 files changed, 6 insertions, 2 deletions
diff --git a/animism-align/frontend/app/views/align/components/annotations/annotation.form.js b/animism-align/frontend/app/views/align/components/annotations/annotation.form.js
index 829d3ae..f20e70a 100644
--- a/animism-align/frontend/app/views/align/components/annotations/annotation.form.js
+++ b/animism-align/frontend/app/views/align/components/annotations/annotation.form.js
@@ -5,7 +5,7 @@ import { connect } from 'react-redux'
import actions from 'app/actions'
-import { ZOOM_STEPS } from 'app/constants'
+import { MEDIA_ANNOTATION_TYPES } from 'app/constants'
import { clamp, timestamp, capitalize } from 'app/utils'
import { timeToPosition } from 'app/utils/align.utils'
import { Select } from 'app/common'
@@ -87,6 +87,10 @@ class AnnotationForm extends Component {
if (annotation.type === 'paragraph_end') {
annotation.text = ''
}
+ if (annotation.type in MEDIA_ANNOTATION_TYPES) {
+ if (!annotation.settings.media_id) return
+ annotation.text = ''
+ }
if (annotation.id === 'new') {
delete annotation.id
actions.annotation.create(annotation)
diff --git a/animism-align/frontend/app/views/viewer/viewer.actions.js b/animism-align/frontend/app/views/viewer/viewer.actions.js
index 3a25519..5d6775f 100644
--- a/animism-align/frontend/app/views/viewer/viewer.actions.js
+++ b/animism-align/frontend/app/views/viewer/viewer.actions.js
@@ -79,8 +79,8 @@ export const loadSections = () => dispatch => {
// add media to the current section.
if (MEDIA_ANNOTATION_TYPES.has(annotation.type)) {
- // fetch the media and add it to the list of media (TODO: handle carousels)
const media = mediaLookup[annotation.settings.media_id]
+ // fetch the media and add it to the list of media (TODO: handle carousels)
if (!media.settings.hide_in_bibliography && !(media.id in seenMedia)) {
currentSection.media.push({
start_ts: annotation.start_ts,