Shorten the code that inits AnnotationEditorLayerBuilder in the web/pdf_page_view.js file

This code can now utilize logical OR assignment, which is ever so slightly shorter.
This commit is contained in:
Jonas Jenwald 2024-08-31 11:58:43 +02:00
parent f6216df889
commit 044f1c9e07

View file

@ -1078,15 +1078,13 @@ 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,
@ -1098,7 +1096,6 @@ class PDFPageView {
this.#addLayer(annotationEditorLayerDiv, "annotationEditorLayer"); this.#addLayer(annotationEditorLayerDiv, "annotationEditorLayer");
}, },
}); });
}
this.#renderAnnotationEditorLayer(); this.#renderAnnotationEditorLayer();
}, },
error => { error => {