From f94b34878229b84048a85b53178f6dc943054408 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 2 Feb 2023 21:17:49 +0100 Subject: [PATCH] Remove the `loadingIcon` in all cases when resetting the page (PR 15992 follow-up) *Unfortunately I missed this during testing/reviewing of PR 15992.* With the changes in PR 15992 we're now only adding the `loadingIcon`-class when rendering is actually `RUNNING`, in order to improve overall performance. However when resetting the page, i.e. the `INITIAL` state, we also need to remove the `loadingIcon` completely. Without this patch if you scroll through a document where the pages don't load instantaneously, see e.g. issue 2504, we'll leave the `loadingIcon`-class attached to pages that have had their rendering cancelled *and* also been evicted from the `PDFPageViewBuffer`-instance. --- web/pdf_page_view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/pdf_page_view.js b/web/pdf_page_view.js index 87691fbac..ab49dbd82 100644 --- a/web/pdf_page_view.js +++ b/web/pdf_page_view.js @@ -245,7 +245,6 @@ class PDFPageView { } switch (state) { - case RenderingStates.INITIAL: case RenderingStates.PAUSED: this.div.classList.remove("loading"); break; @@ -260,6 +259,7 @@ class PDFPageView { this.#loadingId = null; }, 0); break; + case RenderingStates.INITIAL: case RenderingStates.FINISHED: this.div.classList.remove("loadingIcon", "loading"); break;