mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 01:35:43 +02:00
Inline the #finishRendering
helper in TextLayerBuilder.prototype.render
This helper method is simpler/shorter than it originally was[1] and with recent refactoring so is the `render`-method, hence we can just inline this code now. --- [1] It used to e.g. dispatch the "textlayerrendered" event.
This commit is contained in:
parent
6a71f692bf
commit
f7cbd7d16b
1 changed files with 7 additions and 11 deletions
|
@ -68,16 +68,6 @@ class TextLayerBuilder {
|
||||||
this.div.className = "textLayer";
|
this.div.className = "textLayer";
|
||||||
}
|
}
|
||||||
|
|
||||||
#finishRendering() {
|
|
||||||
this.#renderingDone = true;
|
|
||||||
|
|
||||||
const endOfContent = document.createElement("div");
|
|
||||||
endOfContent.className = "endOfContent";
|
|
||||||
this.div.append(endOfContent);
|
|
||||||
|
|
||||||
this.#bindMouse(endOfContent);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders the text layer.
|
* Renders the text layer.
|
||||||
* @param {PageViewport} viewport
|
* @param {PageViewport} viewport
|
||||||
|
@ -110,7 +100,13 @@ class TextLayerBuilder {
|
||||||
this.accessibilityManager?.setTextMapping(textDivs);
|
this.accessibilityManager?.setTextMapping(textDivs);
|
||||||
|
|
||||||
await this.#textLayer.render();
|
await this.#textLayer.render();
|
||||||
this.#finishRendering();
|
this.#renderingDone = true;
|
||||||
|
|
||||||
|
const endOfContent = document.createElement("div");
|
||||||
|
endOfContent.className = "endOfContent";
|
||||||
|
this.div.append(endOfContent);
|
||||||
|
|
||||||
|
this.#bindMouse(endOfContent);
|
||||||
// Ensure that the textLayer is appended to the DOM *before* handling
|
// Ensure that the textLayer is appended to the DOM *before* handling
|
||||||
// e.g. a pending search operation.
|
// e.g. a pending search operation.
|
||||||
this.#onAppend?.(this.div);
|
this.#onAppend?.(this.div);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue