Merge pull request #17192 from Snuffleupagus/textLayer-pause-l10n

Pause translation when appending the textLayer and structTreeLayer to the page
This commit is contained in:
Jonas Jenwald 2023-10-29 09:31:09 +01:00 committed by GitHub
commit 26fc69f241
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 4 deletions

View file

@ -436,7 +436,10 @@ class PDFPageView {
: null);
const treeDom = this.structTreeLayer?.render(tree);
if (treeDom) {
// Pause translation when inserting the structTree in the DOM.
this.l10n.pause();
this.canvas?.append(treeDom);
this.l10n.resume();
}
this.structTreeLayer?.show();
}
@ -863,7 +866,12 @@ class PDFPageView {
enablePermissions:
this.#textLayerMode === TextLayerMode.ENABLE_PERMISSIONS,
});
div.append(this.textLayer.div);
this.textLayer.onAppend = textLayerDiv => {
// Pause translation when inserting the textLayer in the DOM.
this.l10n.pause();
this.div.append(textLayerDiv);
this.l10n.resume();
};
}
if (