From 49fb1cf616b31792729a012eed9bf82e9fa91e8f Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 8 Jul 2020 23:52:06 +0200 Subject: displaying media annotations. delete annotations --- .../align/components/annotations/annotation.form.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'animism-align/frontend/views/align/components/annotations/annotation.form.js') diff --git a/animism-align/frontend/views/align/components/annotations/annotation.form.js b/animism-align/frontend/views/align/components/annotations/annotation.form.js index 0a71233..eb5c0ad 100644 --- a/animism-align/frontend/views/align/components/annotations/annotation.form.js +++ b/animism-align/frontend/views/align/components/annotations/annotation.form.js @@ -23,6 +23,7 @@ class AnnotationForm extends Component { this.handleSettingsSelect = this.handleSettingsSelect.bind(this) this.handleKeyDown = this.handleKeyDown.bind(this) this.handleSubmit = this.handleSubmit.bind(this) + this.handleDestroy = this.handleDestroy.bind(this) this.textareaRef = React.createRef() } componentDidMount() { @@ -91,6 +92,18 @@ class AnnotationForm extends Component { }) } } + handleDestroy() { + const { annotation } = this.props + if (annotation.id === 'new') { + actions.align.hideAnnotationForm() + } else { + actions.annotation.destroy(annotation) + .then(response => { + console.log(response) + actions.align.hideAnnotationForm() + }) + } + } render() { const { timeline, annotation } = this.props if (!annotation.start_ts) return
@@ -122,7 +135,10 @@ class AnnotationForm extends Component { />
{timestamp(annotation.start_ts, 1, true)}
- +
+ {annotation.id !== 'new' && } + +
) } -- cgit v1.2.3-70-g09d2