Skip to content

Add support for onChangeCodeview callback #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default RichTextEditor;
| onKeyUp | `Function` | `e.keyCode` is released |
| onPaste | `Function` | Triggers when event paste's been called |
| onChange | `Function` | handler: `function(contents, $editable) {}`, invoked, when content's been changed |
| onChangeCodeView | `Function` | handler: `function(contents) {}`, invoked, when content's been changed in codeview |
| onImageUpload | `Function` | handler: `function(files) {}` |

### Static methods
Expand Down
6 changes: 4 additions & 2 deletions src/Summernote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ class ReactSummernote extends Component {
onKeydown: props.onKeyDown,
onPaste: props.onPaste,
onChange: props.onChange,
onImageUpload: this.onImageUpload
onImageUpload: this.onImageUpload,
onChangeCodeview: props.onChangeCodeview
};
}

Expand Down Expand Up @@ -218,7 +219,8 @@ ReactSummernote.propTypes = {
onKeyDown: PropTypes.func,
onPaste: PropTypes.func,
onChange: PropTypes.func,
onImageUpload: PropTypes.func
onImageUpload: PropTypes.func,
onChangeCodeview: PropTypes.func
};

ReactSummernote.defaultProps = {
Expand Down