Skip to content
Snippets Groups Projects
Commit 43f9e6ee authored by Jack Reed's avatar Jack Reed
Browse files

Reorder some methods based off of recent linting

parent 12dbb946
No related branches found
No related tags found
No related merge requests found
...@@ -93,36 +93,36 @@ class AnnotationCreation extends Component { ...@@ -93,36 +93,36 @@ class AnnotationCreation extends Component {
} }
/** */ /** */
openChooseColor(e) { handleCloseLineWeight(e) {
this.setState({ this.setState({
colorPopoverOpen: true, lineWeightPopoverOpen: false,
currentColorType: e.currentTarget.value, popoverLineWeightAnchorEl: null,
popoverAnchorEl: e.currentTarget,
}); });
} }
/** */ /** */
openChooseLineWeight(e) { handleLineWeightSelect(e) {
this.setState({ this.setState({
lineWeightPopoverOpen: true, lineWeightPopoverOpen: false,
popoverLineWeightAnchorEl: e.currentTarget, popoverLineWeightAnchorEl: null,
strokeWidth: e.currentTarget.value,
}); });
} }
/** */ /** */
handleLineWeightSelect(e) { openChooseColor(e) {
this.setState({ this.setState({
lineWeightPopoverOpen: false, colorPopoverOpen: true,
popoverLineWeightAnchorEl: null, currentColorType: e.currentTarget.value,
strokeWidth: e.currentTarget.value, popoverAnchorEl: e.currentTarget,
}); });
} }
/** */ /** */
handleCloseLineWeight(e) { openChooseLineWeight(e) {
this.setState({ this.setState({
lineWeightPopoverOpen: false, lineWeightPopoverOpen: true,
popoverLineWeightAnchorEl: null, popoverLineWeightAnchorEl: e.currentTarget,
}); });
} }
......
...@@ -22,21 +22,6 @@ class TextEditor extends Component { ...@@ -22,21 +22,6 @@ class TextEditor extends Component {
this.handleFormating = this.handleFormating.bind(this); 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) { handleFormating(e, newFormat) {
const { editorState } = this.state; const { editorState } = this.state;
...@@ -53,6 +38,21 @@ class TextEditor extends Component { ...@@ -53,6 +38,21 @@ class TextEditor extends Component {
return 'not-handled'; 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() { render() {
const { classes } = this.props; const { classes } = this.props;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment