Skip to content

Commit

Permalink
Merge pull request #18217 from Snuffleupagus/inline-finishRendering
Browse files Browse the repository at this point in the history
Inline the `#finishRendering` helper in `TextLayerBuilder.prototype.render`
  • Loading branch information
timvandermeij authored Jun 7, 2024
2 parents 593ce96 + f7cbd7d commit b557fba
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions web/text_layer_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,6 @@ class TextLayerBuilder {
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.
* @param {PageViewport} viewport
Expand Down Expand Up @@ -110,7 +100,13 @@ class TextLayerBuilder {
this.accessibilityManager?.setTextMapping(textDivs);

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
// e.g. a pending search operation.
this.#onAppend?.(this.div);
Expand Down

0 comments on commit b557fba

Please sign in to comment.