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);
|
!this.props.annotation?.isEqual(this.state.currentAnnotation);
|
||||||
|
|
||||||
/** Shorthand **/
|
/** Shorthand **/
|
||||||
updateCurrentAnnotation = (diff, saveImmediately) => this.setState({
|
updateCurrentAnnotation = (diff, saveImmediately) => {
|
||||||
currentAnnotation: this.state.currentAnnotation.clone(diff)
|
this.setState({
|
||||||
}, () => {
|
currentAnnotation: this.state.currentAnnotation.clone(diff)
|
||||||
if (saveImmediately)
|
}, () => {
|
||||||
this.onOk();
|
if (saveImmediately)
|
||||||
})
|
this.onOk();
|
||||||
|
else
|
||||||
|
this.props.onChanged && this.props.onChanged();
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
onAppendBody = (body, saveImmediately) => this.updateCurrentAnnotation({
|
onAppendBody = (body, saveImmediately) => this.updateCurrentAnnotation({
|
||||||
body: [
|
body: [
|
||||||
|
|
Loading…
Reference in New Issue