From 349ee65db67aa0d28d3861530e8e7e1b5cc27c48 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 5 Jul 2020 17:17:59 +0200 Subject: selected paragraph actions --- .../views/align/components/annotations/annotation.index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'animism-align/frontend/views/align/components/annotations/annotation.index.js') 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 9117a80..8121d1d 100644 --- a/animism-align/frontend/views/align/components/annotations/annotation.index.js +++ b/animism-align/frontend/views/align/components/annotations/annotation.index.js @@ -42,14 +42,16 @@ class AnnotationIndex extends Component { this.setState({ items }) } handleClick(e, annotation) { + e.stopPropagation() actions.audio.seek(annotation.start_ts) actions.align.setSelectedAnnotation(annotation.id) } handleDoubleClick(e, annotation) { + e.stopPropagation() actions.align.showEditAnnotationForm(annotation) } render() { - const { timeline } = this.props + const { timeline, annotationInForm } = this.props const { start_ts, zoom, selected_annotation_id } = timeline const { items } = this.state const className = (zoom < 2) @@ -60,6 +62,9 @@ class AnnotationIndex extends Component { return (
{items.map(annotation => { + if (annotationInForm && annotation.id === annotationInForm.id) { + return null + } const { id, type, start_ts } = annotation const AnnotationElement = AnnotationElementLookup[type] const y = timeToPosition(start_ts, timeline) @@ -81,6 +86,7 @@ class AnnotationIndex extends Component { const mapStateToProps = state => ({ timeline: state.align.timeline, + annotationInForm: state.align.annotation, index: state.annotation.index, }) -- cgit v1.2.3-70-g09d2