summaryrefslogtreecommitdiff
path: root/animism-align/frontend/views/align/components
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-07-05 17:17:59 +0200
committerJules Laplace <julescarbon@gmail.com>2020-07-05 17:17:59 +0200
commit349ee65db67aa0d28d3861530e8e7e1b5cc27c48 (patch)
tree0d2703eb7f2c844e5ae2b4103cae664f6871ee88 /animism-align/frontend/views/align/components
parent9ceecc1561fbd7d8d704b2f491957eebdb202ab7 (diff)
selected paragraph actions
Diffstat (limited to 'animism-align/frontend/views/align/components')
-rw-r--r--animism-align/frontend/views/align/components/annotations/annotation.index.js8
1 files changed, 7 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 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 (
<div className={className}>
{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,
})