summaryrefslogtreecommitdiff
path: root/animism-align/frontend/views/align/components
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-07-17 19:50:25 +0200
committerJules Laplace <julescarbon@gmail.com>2020-07-17 19:50:25 +0200
commit136efc89b1006990e99039c5320c31cd2f29425e (patch)
tree893916e7326c06a5ebaf6e56c2a4611e763848f9 /animism-align/frontend/views/align/components
parent649fec4f153ea1c72d2fa3ea89d7d3998237de3a (diff)
properly update display of annotation when adjusting time
Diffstat (limited to 'animism-align/frontend/views/align/components')
-rw-r--r--animism-align/frontend/views/align/components/annotations/annotation.index.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/animism-align/frontend/views/align/components/annotations/annotation.index.js b/animism-align/frontend/views/align/components/annotations/annotation.index.js
index 65de5dd..4c3631f 100644
--- a/animism-align/frontend/views/align/components/annotations/annotation.index.js
+++ b/animism-align/frontend/views/align/components/annotations/annotation.index.js
@@ -76,7 +76,7 @@ class AnnotationIndex extends Component {
actions.align.showEditAnnotationForm(annotation)
}
render() {
- const { timeline, media, annotationInForm } = this.props
+ const { timeline, media, annotationInForm, selectedAnnotation } = this.props
const { start_ts, zoom, selected_annotation_id } = timeline
const { items } = this.state
const className = (zoom < 2)
@@ -90,6 +90,9 @@ class AnnotationIndex extends Component {
if (annotationInForm && annotation.id === annotationInForm.id) {
return null
}
+ if (annotation.id === selected_annotation_id) {
+ annotation = selectedAnnotation
+ }
const { id, type, start_ts } = annotation
const AnnotationElement = AnnotationElementLookup[type]
const y = timeToPosition(start_ts, timeline)
@@ -113,6 +116,7 @@ class AnnotationIndex extends Component {
const mapStateToProps = state => ({
timeline: state.align.timeline,
annotationInForm: state.align.annotation,
+ selectedAnnotation: state.align.selectedAnnotation,
index: state.annotation.index,
media: state.media.index.lookup,
})