mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-14 03:07:57 +01:00
Fix undo on text editor.
This commit is contained in:
parent
36f435099d
commit
44a6c19912
@ -36,24 +36,24 @@ describe('Node manager', () => {
|
||||
|
||||
it('undo changes', () => {
|
||||
cy.get('body').type('{enter}').type('Mind Mapping rocks!!').type('{enter}');
|
||||
cy.focusTopicByText('Mind Mapping rocks!!');
|
||||
cy.triggerUndo();
|
||||
cy.focusTopicById(36);
|
||||
|
||||
cy.matchImageSnapshot('undoChange');
|
||||
});
|
||||
|
||||
it('redo changes', () => {
|
||||
cy.get('body').type('{enter}').type('Mind Mapping rocks!!').type('{enter}');
|
||||
cy.triggerUndo();
|
||||
cy.focusTopicById(36);
|
||||
cy.focusTopicByText('Mind Mapping rocks!!');
|
||||
|
||||
cy.triggerUndo();
|
||||
cy.triggerRedo();
|
||||
cy.focusTopicById(36);
|
||||
cy.focusTopicByText('Mind Mapping rocks!!');
|
||||
|
||||
cy.matchImageSnapshot('redoChange');
|
||||
});
|
||||
|
||||
it('Save changes', () => {
|
||||
it('save changes', () => {
|
||||
cy.get('body').type('{ctrl}s');
|
||||
cy.matchImageSnapshot('saveChagesShortcut');
|
||||
});
|
||||
|
@ -70,8 +70,6 @@ class EditorComponent extends Events {
|
||||
switch (event.code) {
|
||||
case 'Escape':
|
||||
// Revert to previous text ...
|
||||
this._topic.setText(this._oldText);
|
||||
this.resize();
|
||||
this.close(false);
|
||||
break;
|
||||
case 'Enter': {
|
||||
@ -253,6 +251,8 @@ class EditorComponent extends Events {
|
||||
}
|
||||
|
||||
close(update: boolean): void {
|
||||
this._topic.setText(this._oldText);
|
||||
|
||||
if (update) {
|
||||
this.updateModel();
|
||||
}
|
||||
@ -261,6 +261,8 @@ class EditorComponent extends Events {
|
||||
|
||||
// Restore topoc share visibility ...
|
||||
this._topic.getOrBuildTextShape().setVisibility(true);
|
||||
|
||||
this.resize();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user