Skip to content

Commit

Permalink
Improve JS modularity
Browse files Browse the repository at this point in the history
  • Loading branch information
pklaschka committed Jun 5, 2024
1 parent f7a435f commit a5ff76e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions assets/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
const pdfPreview = document.querySelector("iframe");
(function fixPdfOverflow() {
const pdfPreview = document.querySelector("iframe");

if (pdfPreview) {
pdfPreview.onload = function () {
pdfPreview.contentWindow.document.body.style.overflow = "hidden";
};
}
if (!pdfPreview) {
return;
}
pdfPreview.onload = function () {
pdfPreview.contentWindow.document.body.style.overflow = "hidden";
};
})();

0 comments on commit a5ff76e

Please sign in to comment.