mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
unsaved changes cancel confirmation
This commit is contained in:
parent
1ca2691a15
commit
3363708c1f
4 changed files with 50 additions and 1 deletions
|
@ -23,7 +23,13 @@ export class EditorPanel extends React.PureComponent {
|
|||
|
||||
startSaveMode = () => this.props.editor.changeMode(MODES.SAVE);
|
||||
|
||||
stopEditing = () => this.props.editor.stopEditing();
|
||||
stopEditing = () => {
|
||||
if (!this.props.changed){
|
||||
this.props.editor.stopEditing();
|
||||
} else {
|
||||
this.props.editor.changeMode(MODES.CONFIRM_CANCEL);
|
||||
}
|
||||
};
|
||||
|
||||
startEditing = () => this.props.editor.startEditing();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue