From b7142402f8cfbbb8932a1b256fd3fb935234c4bf Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 18 Jul 2020 16:04:15 +0200 Subject: ability to reset paragraph index --- .../views/align/components/annotations/annotation.index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (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 4c3631f..30dc7c0 100644 --- a/animism-align/frontend/views/align/components/annotations/annotation.index.js +++ b/animism-align/frontend/views/align/components/annotations/annotation.index.js @@ -45,17 +45,16 @@ class AnnotationIndex extends Component { e.stopPropagation() if (e.shiftKey) { e.preventDefault() - this.handleParagraphSelection(annotation) + this.handleParagraphSelection(annotation, e.metaKey) } actions.audio.seek(annotation.start_ts) actions.align.setSelectedAnnotation(annotation) } - handleParagraphSelection(annotation) { + handleParagraphSelection(annotation, shouldClear) { const { selected_paragraph_id } = this.props.timeline - if (!selected_paragraph_id || selected_paragraph_id === -1) { - if (annotation.paragraph_id) { + if (!selected_paragraph_id || selected_paragraph_id === -1 || shouldClear) { + if (annotation.paragraph_id && !shouldClear) { actions.align.setSelectedParagraph(annotation.paragraph_id) - return } else { actions.paragraph.create({ type: 'paragraph', -- cgit v1.2.3-70-g09d2