From 0c033aab50f209ed1e3a4632932118e7bf8f08aa Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Sun, 13 Sep 2020 08:35:01 +0200 Subject: [PATCH] Fixes to text annotation concerning new plugin API --- src/TextAnnotator.jsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/TextAnnotator.jsx b/src/TextAnnotator.jsx index bfeef3b..1b3dac0 100644 --- a/src/TextAnnotator.jsx +++ b/src/TextAnnotator.jsx @@ -34,9 +34,9 @@ export default class TextAnnotator extends Component { } componentDidMount() { - this.highlighter = new Highlighter(this.props.contentEl, this.props.formatter); + this.highlighter = new Highlighter(this.props.contentEl, this.props.config.formatter); - this.selectionHandler = new SelectionHandler(this.props.contentEl, this.highlighter, this.props.readOnly); + this.selectionHandler = new SelectionHandler(this.props.contentEl, this.highlighter, this.props.config.readOnly); this.selectionHandler.on('select', this.handleSelect); this.relationsLayer = new RelationsLayer(this.props.contentEl); @@ -266,8 +266,7 @@ export default class TextAnnotator extends Component { wrapperEl={this.props.wrapperEl} annotation={this.state.selectedAnnotation} selectedElement={this.state.selectedDOMElement} - readOnly={this.props.readOnly} - headless={this.state.headless} + config={this.props.config} applyTemplate={this.state.applyTemplate} onAnnotationCreated={this.onCreateOrUpdateAnnotation('onAnnotationCreated')} onAnnotationUpdated={this.onCreateOrUpdateAnnotation('onAnnotationUpdated')}