From 5907d877741bc37d3f14eff814e47c86aaebaa1a Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 3 Jun 2026 13:46:40 +0200 Subject: [PATCH] Remove the `#externalHide` field from the `AnnotationLayerBuilder` class Prior to PR 20321 the annotationLayer was hidden when there was no regular annotations on the page, which meant that if there were any inferred links (from the textLayer) the annotationLayer needed to be made visible but in such a way that it wouldn't override an explicit `hide`-call from the `PDFPageView` class. With the changes in the aforementioned PR the annotationLayer is now always "visible", and this code can thus be simplified a little bit. --- web/annotation_layer_builder.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/web/annotation_layer_builder.js b/web/annotation_layer_builder.js index 963d006a9..bb30dd6bb 100644 --- a/web/annotation_layer_builder.js +++ b/web/annotation_layer_builder.js @@ -72,8 +72,6 @@ class AnnotationLayerBuilder { #commentManager = null; - #externalHide = false; - #onAppend = null; #eventAC = null; @@ -226,8 +224,7 @@ class AnnotationLayerBuilder { this.#eventAC = null; } - hide(internal = false) { - this.#externalHide = !internal; + hide() { if (!this.div) { return; } @@ -263,10 +260,6 @@ class AnnotationLayerBuilder { } await this.annotationLayer.addLinkAnnotations(newLinks); - // Don't show the annotation layer if it was explicitly hidden previously. - if (!this.#externalHide) { - this.div.hidden = false; - } } #updatePresentationModeState(state) {