Merge pull request #20189 from timvandermeij/null-signal
[Editor] Don't use a null signal for the comment button
This commit is contained in:
commit
649a03f817
@ -39,12 +39,17 @@ class Comment {
|
|||||||
if (!this.#editor._uiManager.hasCommentManager()) {
|
if (!this.#editor._uiManager.hasCommentManager()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const comment = (this.#commentButton = document.createElement("button"));
|
const comment = (this.#commentButton = document.createElement("button"));
|
||||||
comment.className = "comment";
|
comment.className = "comment";
|
||||||
comment.tabIndex = "0";
|
comment.tabIndex = "0";
|
||||||
comment.setAttribute("data-l10n-id", "pdfjs-editor-edit-comment-button");
|
comment.setAttribute("data-l10n-id", "pdfjs-editor-edit-comment-button");
|
||||||
|
|
||||||
const signal = this.#editor._uiManager._signal;
|
const signal = this.#editor._uiManager._signal;
|
||||||
|
if (!(signal instanceof AbortSignal) || signal.aborted) {
|
||||||
|
return comment;
|
||||||
|
}
|
||||||
|
|
||||||
comment.addEventListener("contextmenu", noContextMenu, { signal });
|
comment.addEventListener("contextmenu", noContextMenu, { signal });
|
||||||
comment.addEventListener("pointerdown", event => event.stopPropagation(), {
|
comment.addEventListener("pointerdown", event => event.stopPropagation(), {
|
||||||
signal,
|
signal,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user