mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-26 18:15:48 +02:00
Merge pull request #20934 from Snuffleupagus/fix-TextLayerBuilder-abortSignal
Ensure that `TextLayerBuilder` works correctly without the `abortSignal` parameter (PR 20928 follow-up)
This commit is contained in:
commit
d66629376e
@ -169,13 +169,14 @@ class TextLayerBuilder {
|
|||||||
#bindMouse(end) {
|
#bindMouse(end) {
|
||||||
const { div } = this;
|
const { div } = this;
|
||||||
const abortSignal = this.#abortSignal;
|
const abortSignal = this.#abortSignal;
|
||||||
|
const opts = abortSignal ? { signal: abortSignal } : null;
|
||||||
|
|
||||||
div.addEventListener(
|
div.addEventListener(
|
||||||
"mousedown",
|
"mousedown",
|
||||||
() => {
|
() => {
|
||||||
div.classList.add("selecting");
|
div.classList.add("selecting");
|
||||||
},
|
},
|
||||||
{ signal: abortSignal }
|
opts
|
||||||
);
|
);
|
||||||
|
|
||||||
div.addEventListener(
|
div.addEventListener(
|
||||||
@ -190,7 +191,7 @@ class TextLayerBuilder {
|
|||||||
}
|
}
|
||||||
stopEvent(event);
|
stopEvent(event);
|
||||||
},
|
},
|
||||||
{ signal: abortSignal }
|
opts
|
||||||
);
|
);
|
||||||
|
|
||||||
TextLayerBuilder.#textLayers.set(div, end);
|
TextLayerBuilder.#textLayers.set(div, end);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user