From f99cdf970bd175c6ff74a83da9c69c0024903640 Mon Sep 17 00:00:00 2001 From: robertwenink Date: Thu, 31 Aug 2023 11:22:36 +0200 Subject: [PATCH 1/3] update showPaginator Paginator is not hidden when style is inherited. Better to set display to 'none' explicitly. --- layouts/shortcodes/embed-pdf.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/embed-pdf.html b/layouts/shortcodes/embed-pdf.html index 1c2ecd6..e25e947 100644 --- a/layouts/shortcodes/embed-pdf.html +++ b/layouts/shortcodes/embed-pdf.html @@ -203,8 +203,12 @@ * If we haven't disabled the paginator, show paginator */ function showPaginator() { - if(hidePaginator) return - paginator.style.display = 'block'; + if(hidePaginator) { + paginator.style.display = 'none'; + } + else { + paginator.style.display = 'block'; + } } /** From 742ff8da1a8cc7fcb1db153914816cf691f4ddbb Mon Sep 17 00:00:00 2001 From: robertwenink Date: Thu, 31 Aug 2023 12:23:08 +0200 Subject: [PATCH 2/3] Update embed-pdf.html added / to path. Otherwise, workerSrc not found if baseUrl does not end with / --- layouts/shortcodes/embed-pdf.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/shortcodes/embed-pdf.html b/layouts/shortcodes/embed-pdf.html index e25e947..080ddf8 100644 --- a/layouts/shortcodes/embed-pdf.html +++ b/layouts/shortcodes/embed-pdf.html @@ -128,7 +128,7 @@ // The workerSrc property shall be specified. if (pdfjsLib.GlobalWorkerOptions.workerSrc == '') - pdfjsLib.GlobalWorkerOptions.workerSrc = "{{.Site.BaseURL}}" + 'js/pdf-js/build/pdf.worker.js'; + pdfjsLib.GlobalWorkerOptions.workerSrc = "{{.Site.BaseURL}}" + '/js/pdf-js/build/pdf.worker.js'; // Change the Scale value for lower or higher resolution. var pdfDoc = null, From d456c1eae986de1a4fda37f9ae76d40ce946e5d1 Mon Sep 17 00:00:00 2001 From: robertwenink Date: Thu, 31 Aug 2023 13:39:54 +0200 Subject: [PATCH 3/3] Update embed-pdf.html Make the loading wrapper float left, such that the download button is not pushed down during loading but stays in its location. --- layouts/shortcodes/embed-pdf.html | 1 + 1 file changed, 1 insertion(+) diff --git a/layouts/shortcodes/embed-pdf.html b/layouts/shortcodes/embed-pdf.html index 080ddf8..ce992ff 100644 --- a/layouts/shortcodes/embed-pdf.html +++ b/layouts/shortcodes/embed-pdf.html @@ -34,6 +34,7 @@ align-items: center; width: 100%; height: 350px; + float: left; } .pdf-loading {