Added onChanged callback to Editor
This commit is contained in:
parent
763b7999b9
commit
2ee94add58
|
@ -126,12 +126,16 @@ export default class Editor extends Component {
|
|||
!this.props.annotation?.isEqual(this.state.currentAnnotation);
|
||||
|
||||
/** Shorthand **/
|
||||
updateCurrentAnnotation = (diff, saveImmediately) => this.setState({
|
||||
updateCurrentAnnotation = (diff, saveImmediately) => {
|
||||
this.setState({
|
||||
currentAnnotation: this.state.currentAnnotation.clone(diff)
|
||||
}, () => {
|
||||
if (saveImmediately)
|
||||
this.onOk();
|
||||
else
|
||||
this.props.onChanged && this.props.onChanged();
|
||||
})
|
||||
}
|
||||
|
||||
onAppendBody = (body, saveImmediately) => this.updateCurrentAnnotation({
|
||||
body: [
|
||||
|
|
Loading…
Reference in New Issue