Skip to content

Commit

Permalink
add readonly classname
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoHai committed May 3, 2017
1 parent 47a819b commit 7a35e25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/controllered.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Editor extends React.Component {
value: this.state.defaultValue,
});
}
toggleReadOnly() {
toggleReadOnly = () => {
this.setState({
readOnly: !this.state.readOnly,
})
Expand Down
4 changes: 2 additions & 2 deletions src/EditorCore/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -469,15 +469,15 @@ class EditorCore extends React.Component<EditorProps, EditorCoreState> {
return 'not-handled';
}
render() {
const { prefixCls, toolbars, style } = this.props;
const { prefixCls, toolbars, style, readOnly } = this.props;
const { editorState, toolbarPlugins } = this.state;
const customStyleMap = configStore.get('customStyleMap');
const blockRenderMap = configStore.get('blockRenderMap');
const eventHandler = this.getEventHandler();
const Toolbar = toolbar.component;
return (<div
style={style}
className={`${prefixCls}-editor`}
className={`${prefixCls}-editor ${readOnly ? 'readonly' : ''}`}
onClick={this.focus.bind(this)}
>
<Toolbar
Expand Down

0 comments on commit 7a35e25

Please sign in to comment.