1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

[Editor] Make a deleted (when it was invisible) editor undoable

When the editor is invisible (because on a non-rendered page) its parent is null.
But when we undo its deletion, we need to have a parent to attach it.
This commit is contained in:
Calixte Denizet 2023-09-29 16:19:02 +02:00
parent 46940a5a52
commit b65b079ceb
2 changed files with 70 additions and 0 deletions

View file

@ -432,6 +432,7 @@ class AnnotationEditorLayer {
*/
addOrRebuild(editor) {
if (editor.needsToBeRebuilt()) {
editor.parent ||= this;
editor.rebuild();
} else {
this.add(editor);