Merge pull request #15187 from calixteman/rm_useless_ed
[Editor] Remove useless and potentially deleted editors
This commit is contained in:
commit
33d7a35515
@ -786,6 +786,7 @@ class AnnotationEditorUIManager {
|
|||||||
delete() {
|
delete() {
|
||||||
let cmd, undo;
|
let cmd, undo;
|
||||||
if (this.#isAllSelected) {
|
if (this.#isAllSelected) {
|
||||||
|
this.#previousActiveEditor = this.#activeEditor = null;
|
||||||
const editors = Array.from(this.#allEditors.values());
|
const editors = Array.from(this.#allEditors.values());
|
||||||
cmd = () => {
|
cmd = () => {
|
||||||
for (const editor of editors) {
|
for (const editor of editors) {
|
||||||
@ -807,6 +808,7 @@ class AnnotationEditorUIManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const editor = this.#activeEditor;
|
const editor = this.#activeEditor;
|
||||||
|
this.#previousActiveEditor = this.#activeEditor = null;
|
||||||
cmd = () => {
|
cmd = () => {
|
||||||
editor.remove();
|
editor.remove();
|
||||||
};
|
};
|
||||||
@ -834,15 +836,7 @@ class AnnotationEditorUIManager {
|
|||||||
cut() {
|
cut() {
|
||||||
if (this.#activeEditor) {
|
if (this.#activeEditor) {
|
||||||
this.#clipboardManager.copy(this.#activeEditor);
|
this.#clipboardManager.copy(this.#activeEditor);
|
||||||
const editor = this.#activeEditor;
|
this.delete();
|
||||||
const cmd = () => {
|
|
||||||
editor.remove();
|
|
||||||
};
|
|
||||||
const undo = () => {
|
|
||||||
this.#addEditorToLayer(editor);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.addCommands({ cmd, undo, mustExec: true });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user