diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-connection-style.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-connection-style.snap.png index 46881cb4..861e0b69 100644 Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-connection-style.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-connection-style.snap.png differ diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-error-on-load.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-error-on-load.snap.png index d338a5a6..85900ccc 100644 Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-error-on-load.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-error-on-load.snap.png differ diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-icon-sample.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-icon-sample.snap.png index d1f79d3a..37dde9e2 100644 Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-icon-sample.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-icon-sample.snap.png differ diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample1.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample1.snap.png index d4fb0b18..be5a32a8 100644 Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample1.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample1.snap.png differ diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample3.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample3.snap.png index a98335b7..6b3a301a 100644 Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample3.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample3.snap.png differ diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample4.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample4.snap.png index 0fe56d70..0f585d1c 100644 Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample4.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample4.snap.png differ diff --git a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample5.snap.png b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample5.snap.png index d1ae02b4..0bcebd37 100644 Binary files a/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample5.snap.png and b/packages/editor/cypress/snapshots/renderAll.cy.ts/map-sample5.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicManager.cy.ts/deleteTopicShortcut.snap.png b/packages/editor/cypress/snapshots/topicManager.cy.ts/deleteTopicShortcut.snap.png index 587e03b8..bd64cf8d 100644 Binary files a/packages/editor/cypress/snapshots/topicManager.cy.ts/deleteTopicShortcut.snap.png and b/packages/editor/cypress/snapshots/topicManager.cy.ts/deleteTopicShortcut.snap.png differ diff --git a/packages/editor/cypress/snapshots/topicManager.cy.ts/redoChange.snap.png b/packages/editor/cypress/snapshots/topicManager.cy.ts/redoChange.snap.png index 9a77cf9c..7dd3639f 100644 Binary files a/packages/editor/cypress/snapshots/topicManager.cy.ts/redoChange.snap.png and b/packages/editor/cypress/snapshots/topicManager.cy.ts/redoChange.snap.png differ diff --git a/packages/mindplot/src/components/MultilineTextEditor.ts b/packages/mindplot/src/components/MultilineTextEditor.ts index c8c1bca7..8d70d24b 100644 --- a/packages/mindplot/src/components/MultilineTextEditor.ts +++ b/packages/mindplot/src/components/MultilineTextEditor.ts @@ -31,7 +31,9 @@ class EditorComponent extends Events { private _containerElem: JQuery; - constructor(topic: Topic) { + private _onClose: () => void; + + constructor(topic: Topic, onClose: () => void) { super(); this._topic = topic; @@ -40,6 +42,7 @@ class EditorComponent extends Events { $('body').append(this._containerElem); this.registerEvents(this._containerElem); this._oldText = topic.getText(); + this._onClose = onClose; } private static buildEditor(): JQuery { @@ -64,7 +67,7 @@ class EditorComponent extends Events { private registerEvents(containerElem: JQuery): void { const textareaElem = this.getTextareaElem(); - textareaElem.on('keydown', (event) => { + textareaElem.on('keydown', (event: JQuery.KeyDownEvent) => { switch (event.code) { case 'Escape': // Revert to previous text ... @@ -96,7 +99,7 @@ class EditorComponent extends Events { event.stopPropagation(); }); - textareaElem.on('keypress', (event: JQuery.Event) => { + textareaElem.on('keypress', (event: JQuery.KeyPressEvent) => { const c = String.fromCharCode(event.which!); const text = this.getTextareaElem().val() + c; this._topic.setText(text); @@ -241,6 +244,7 @@ class EditorComponent extends Events { } close(update: boolean): void { + // Revert to all text ... this._topic.setText(this._oldText); if (update) { @@ -253,6 +257,9 @@ class EditorComponent extends Events { this._topic.getOrBuildTextShape().setVisibility(true); this.resize(); + + // Purge ... + this._onClose(); } } @@ -281,7 +288,9 @@ class MultitTextEditor { this._component.close(false); } // Create a new instance - this._component = new EditorComponent(topic); + this._component = new EditorComponent(topic, () => { + this._component = null; + }); this._component.show(textOverwrite); } diff --git a/packages/webapp/cypress/snapshots/login.cy.ts/login-page.snap.png b/packages/webapp/cypress/snapshots/login.cy.ts/login-page.snap.png index 80574879..10ff623e 100644 Binary files a/packages/webapp/cypress/snapshots/login.cy.ts/login-page.snap.png and b/packages/webapp/cypress/snapshots/login.cy.ts/login-page.snap.png differ