From cb5f867b14fb93553dc6d2eccb2c624ece7c289b Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Tue, 28 Apr 2020 11:10:00 +0200 Subject: [PATCH] Added missing events for relation CRUD ops --- src/TextAnnotator.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/TextAnnotator.jsx b/src/TextAnnotator.jsx index a5affb5..c618763 100644 --- a/src/TextAnnotator.jsx +++ b/src/TextAnnotator.jsx @@ -129,12 +129,18 @@ export default class TextAnnotator extends Component { onCreateOrUpdateRelation = (relation, previous) => { this.relationsLayer.addOrUpdateRelation(relation, previous); this.closeRelationsEditor(); + + if (previous) + this.props.onAnnotationUpdated(relation, previous); + else + this.props.onAnnotationCreated(relation, previous); } /** 'Delete' on the relation editor popup **/ onDeleteRelation = relation => { this.relationsLayer.removeRelation(relation); this.closeRelationsEditor(); + this.props.onAnnotationDeleted(relation); } /****************/