mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-07 17:05:38 +02:00
Merge pull request #18672 from Snuffleupagus/PDFPageView-AnnotationEditorLayerBuilder-shorter-init
Shorten the code that inits `AnnotationEditorLayerBuilder` in the `web/pdf_page_view.js` file
This commit is contained in:
commit
bde7a84e09
1 changed files with 12 additions and 15 deletions
|
@ -1078,27 +1078,24 @@ class PDFPageView {
|
||||||
if (!annotationEditorUIManager) {
|
if (!annotationEditorUIManager) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.drawLayer ||= new DrawLayerBuilder({
|
this.drawLayer ||= new DrawLayerBuilder({
|
||||||
pageIndex: this.id,
|
pageIndex: this.id,
|
||||||
});
|
});
|
||||||
await this.#renderDrawLayer();
|
await this.#renderDrawLayer();
|
||||||
this.drawLayer.setParent(canvasWrapper);
|
this.drawLayer.setParent(canvasWrapper);
|
||||||
|
|
||||||
if (!this.annotationEditorLayer) {
|
this.annotationEditorLayer ||= new AnnotationEditorLayerBuilder({
|
||||||
this.annotationEditorLayer = new AnnotationEditorLayerBuilder({
|
uiManager: annotationEditorUIManager,
|
||||||
uiManager: annotationEditorUIManager,
|
pdfPage,
|
||||||
pdfPage,
|
l10n,
|
||||||
l10n,
|
accessibilityManager: this._accessibilityManager,
|
||||||
accessibilityManager: this._accessibilityManager,
|
annotationLayer: this.annotationLayer?.annotationLayer,
|
||||||
annotationLayer: this.annotationLayer?.annotationLayer,
|
textLayer: this.textLayer,
|
||||||
textLayer: this.textLayer,
|
drawLayer: this.drawLayer.getDrawLayer(),
|
||||||
drawLayer: this.drawLayer.getDrawLayer(),
|
onAppend: annotationEditorLayerDiv => {
|
||||||
onAppend: annotationEditorLayerDiv => {
|
this.#addLayer(annotationEditorLayerDiv, "annotationEditorLayer");
|
||||||
this.#addLayer(annotationEditorLayerDiv, "annotationEditorLayer");
|
},
|
||||||
},
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
this.#renderAnnotationEditorLayer();
|
this.#renderAnnotationEditorLayer();
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue