From 136efc89b1006990e99039c5320c31cd2f29425e Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 17 Jul 2020 19:50:25 +0200 Subject: properly update display of annotation when adjusting time --- .../frontend/views/align/components/annotations/annotation.index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'animism-align/frontend/views/align') 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, }) -- cgit v1.2.3-70-g09d2