client/src/components/NoteInput.js
changeset 173 0e6703cd0968
parent 171 03334a31130a
child 191 3f71ad81a5a9
--- a/client/src/components/NoteInput.js	Tue Nov 13 16:46:15 2018 +0100
+++ b/client/src/components/NoteInput.js	Fri Nov 16 11:19:13 2018 +0100
@@ -28,7 +28,7 @@
     });
   }
 
-  onAddNoteClick = () => {
+  submitNote = () => {
 
     const plain = this.editor.asPlain();
     const raw = this.editor.asRaw();
@@ -52,10 +52,6 @@
     setTimeout(() => this.editor.focus(), 250);
   }
 
-  onCheckboxChange = (e) => {
-    this.props.setAutoSubmit(e.target.checked);
-  }
-
   componentDidMount() {
     if(this.editor) {
       const text = this.editor.asPlain();
@@ -70,10 +66,7 @@
           <div className="editor-left sticky-bottom px-2">
             <SlateEditor editorRef={this.editorInst}
               onChange={this.onEditorChange}
-              onEnterKeyDown={this.onAddNoteClick}
-              onButtonClick={this.onAddNoteClick}
-              onCheckboxChange={this.onCheckboxChange}
-              isChecked={this.props.autoSubmit}
+              submitNote={this.submitNote}
               isButtonDisabled={this.state.buttonDisabled}
               annotationCategories={ this.props.annotationCategories } />