[Editor] Don't use a null signal for the comment button

This removes the following error from the integration test logs:

```
JavaScript error: http://127.0.0.1:59283/build/generic/build/pdf.mjs, line 3879:
TypeError: EventTarget.addEventListener: 'signal' member of AddEventListenerOptions is not an object.
```

Fixes 636ff50.
Extends 63651885.
This commit is contained in:
Tim van der Meij 2025-08-24 18:22:59 +02:00
parent 535a042b01
commit eec1bea1b4
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762

View File

@ -39,12 +39,17 @@ class Comment {
if (!this.#editor._uiManager.hasCommentManager()) {
return null;
}
const comment = (this.#commentButton = document.createElement("button"));
comment.className = "comment";
comment.tabIndex = "0";
comment.setAttribute("data-l10n-id", "pdfjs-editor-edit-comment-button");
const signal = this.#editor._uiManager._signal;
if (!(signal instanceof AbortSignal) || signal.aborted) {
return comment;
}
comment.addEventListener("contextmenu", noContextMenu, { signal });
comment.addEventListener("pointerdown", event => event.stopPropagation(), {
signal,