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:
parent
46940a5a52
commit
b65b079ceb
2 changed files with 70 additions and 0 deletions
|
@ -432,6 +432,7 @@ class AnnotationEditorLayer {
|
|||
*/
|
||||
addOrRebuild(editor) {
|
||||
if (editor.needsToBeRebuilt()) {
|
||||
editor.parent ||= this;
|
||||
editor.rebuild();
|
||||
} else {
|
||||
this.add(editor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue