Skip to content

Commit

Permalink
Merge pull request #116 from timfanda35/issues/remove-viewerjs-error
Browse files Browse the repository at this point in the history
fix(viewerjs): initialize only in single page
  • Loading branch information
timfanda35 authored Sep 10, 2024
2 parents 373a74e + bab4caa commit 3a8b971
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions themes/simplecss/layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
<!-- ViewerJS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/viewerjs/1.11.6/viewer.min.js" integrity="sha512-EC3CQ+2OkM+ZKsM1dbFAB6OGEPKRxi6EDRnZW9ys8LghQRAq6cXPUgXCCujmDrXdodGXX9bqaaCRtwj4h4wgSQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
const gallery = new Viewer(
document.querySelector("article > div:nth-child(2)"),
{
toolbar: false,
initialCoverage: 1
}
);
const postContent = document.querySelector("article > div:nth-child(2)");
if (postContent) {
new Viewer(
postContent,
{
toolbar: false,
initialCoverage: 1
}
)
}
</script>

0 comments on commit 3a8b971

Please sign in to comment.