diff --git a/src/components/Widgets/MarkdownControl.js b/src/components/Widgets/MarkdownControl.js index 483be419..e010abd9 100644 --- a/src/components/Widgets/MarkdownControl.js +++ b/src/components/Widgets/MarkdownControl.js @@ -7,26 +7,21 @@ import { connect } from 'react-redux'; import { switchVisualMode } from '../../actions/editor'; class MarkdownControl extends React.Component { - constructor(props, context) { - super(props, context); - this.useVisualEditor = this.useVisualEditor.bind(this); - this.useRawEditor = this.useRawEditor.bind(this); - } componentWillMount() { this.useRawEditor(); processEditorPlugins(registry.getEditorComponents()); } - useVisualEditor() { + useVisualEditor = () => { this.props.switchVisualMode(true); } - useRawEditor() { + useRawEditor = () => { this.props.switchVisualMode(false); } - renderEditor() { + render() { const { editor, onChange, onAddMedia, getMedia, value } = this.props; if (editor.get('useVisualMode')) { return ( @@ -55,15 +50,6 @@ class MarkdownControl extends React.Component { ); } } - - render() { - return ( -
- - {this.renderEditor()} -
- ); - } } MarkdownControl.propTypes = {