mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-29 18:37:20 +02:00
[Editor] Only add a popup to an existing annotation if it exits
It fixes the ink integration test "must update an existing annotation".
This commit is contained in:
parent
23bd705cea
commit
6d7e0e7025
@ -215,7 +215,7 @@ class AnnotationElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let popup = this.#popupElement?.popup || this.popup;
|
let popup = this.#popupElement?.popup || this.popup;
|
||||||
if (!popup && newPopup.text) {
|
if (!popup && newPopup?.text) {
|
||||||
this._createPopup(newPopup);
|
this._createPopup(newPopup);
|
||||||
popup = this.#popupElement.popup;
|
popup = this.#popupElement.popup;
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ class AnnotationElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
popup.updateEdited(params);
|
popup.updateEdited(params);
|
||||||
if (newPopup.deleted) {
|
if (newPopup?.deleted) {
|
||||||
popup.remove();
|
popup.remove();
|
||||||
this.#popupElement = null;
|
this.#popupElement = null;
|
||||||
this.popup = null;
|
this.popup = null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user