From 43f9e6eefdb0e4c8d5f5e5a48184209de5f8c2b9 Mon Sep 17 00:00:00 2001 From: Jack Reed <phillipjreed@gmail.com> Date: Tue, 10 Nov 2020 07:16:37 -0700 Subject: [PATCH] Reorder some methods based off of recent linting --- src/AnnotationCreation.js | 28 ++++++++++++++-------------- src/TextEditor.js | 30 +++++++++++++++--------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/AnnotationCreation.js b/src/AnnotationCreation.js index 7452f9a..c58f445 100644 --- a/src/AnnotationCreation.js +++ b/src/AnnotationCreation.js @@ -93,36 +93,36 @@ class AnnotationCreation extends Component { } /** */ - openChooseColor(e) { + handleCloseLineWeight(e) { this.setState({ - colorPopoverOpen: true, - currentColorType: e.currentTarget.value, - popoverAnchorEl: e.currentTarget, + lineWeightPopoverOpen: false, + popoverLineWeightAnchorEl: null, }); } /** */ - openChooseLineWeight(e) { + handleLineWeightSelect(e) { this.setState({ - lineWeightPopoverOpen: true, - popoverLineWeightAnchorEl: e.currentTarget, + lineWeightPopoverOpen: false, + popoverLineWeightAnchorEl: null, + strokeWidth: e.currentTarget.value, }); } /** */ - handleLineWeightSelect(e) { + openChooseColor(e) { this.setState({ - lineWeightPopoverOpen: false, - popoverLineWeightAnchorEl: null, - strokeWidth: e.currentTarget.value, + colorPopoverOpen: true, + currentColorType: e.currentTarget.value, + popoverAnchorEl: e.currentTarget, }); } /** */ - handleCloseLineWeight(e) { + openChooseLineWeight(e) { this.setState({ - lineWeightPopoverOpen: false, - popoverLineWeightAnchorEl: null, + lineWeightPopoverOpen: true, + popoverLineWeightAnchorEl: e.currentTarget, }); } diff --git a/src/TextEditor.js b/src/TextEditor.js index 48bdab8..536ba33 100644 --- a/src/TextEditor.js +++ b/src/TextEditor.js @@ -22,21 +22,6 @@ class TextEditor extends Component { this.handleFormating = this.handleFormating.bind(this); } - /** */ - onChange(editorState) { - const { updateAnnotationBody } = this.props; - this.setState({ editorState }); - if (updateAnnotationBody) { - const options = { - inlineStyles: { - BOLD: { element: 'b' }, - ITALIC: { element: 'i' }, - }, - }; - updateAnnotationBody(stateToHTML(editorState.getCurrentContent(), options).toString()); - } - } - /** */ handleFormating(e, newFormat) { const { editorState } = this.state; @@ -53,6 +38,21 @@ class TextEditor extends Component { return 'not-handled'; } + /** */ + onChange(editorState) { + const { updateAnnotationBody } = this.props; + this.setState({ editorState }); + if (updateAnnotationBody) { + const options = { + inlineStyles: { + BOLD: { element: 'b' }, + ITALIC: { element: 'i' }, + }, + }; + updateAnnotationBody(stateToHTML(editorState.getCurrentContent(), options).toString()); + } + } + /** */ render() { const { classes } = this.props; -- GitLab