summaryrefslogtreecommitdiff
path: root/animism-align/frontend/views/align/components
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-07-18 16:04:15 +0200
committerJules Laplace <julescarbon@gmail.com>2020-07-18 16:04:15 +0200
commitb7142402f8cfbbb8932a1b256fd3fb935234c4bf (patch)
tree50fc96f39efe617e8c39e3988555085b3a24a9ed /animism-align/frontend/views/align/components
parent0a3d12fc8179d6d3c416b5655aa0b86eecbe91dc (diff)
ability to reset paragraph index
Diffstat (limited to 'animism-align/frontend/views/align/components')
-rw-r--r--animism-align/frontend/views/align/components/annotations/annotation.index.js9
-rw-r--r--animism-align/frontend/views/align/components/annotations/annotationTypes/index.js2
2 files changed, 5 insertions, 6 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 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',
diff --git a/animism-align/frontend/views/align/components/annotations/annotationTypes/index.js b/animism-align/frontend/views/align/components/annotations/annotationTypes/index.js
index 3a2fae1..560063b 100644
--- a/animism-align/frontend/views/align/components/annotations/annotationTypes/index.js
+++ b/animism-align/frontend/views/align/components/annotations/annotationTypes/index.js
@@ -1,4 +1,4 @@
-import React from 'React'
+import React from 'react'
import {
AnnotationSentence, AnnotationHeader,