Commit 6cc23f87 authored by julientaq's avatar julientaq

fix scroll on quit

parent 0d8c13c3
......@@ -68,3 +68,9 @@ where you can add the following. WARNING: if you want to use this custom make s
Use those css classes in your CSS:
`.pagedPreviewer-button-modal` to change the button that call the modal. It will be added as the first element of the body element,
`.pagedPreviewer-modal` to change the styles of the modal (warning, it’s using css-grid to make things work).
## TODO 
make it work without server
Factorise UI system
......@@ -33,5 +33,3 @@ html {
font-family: sans-serif;
}
\ No newline at end of file
......@@ -8,10 +8,12 @@
<link rel="stylesheet" href="css/reset.css">
<script type="module" src="../dist/pagedPreviewer.js"></script>
<style>
<style>
.bookContent {
color: black;
}
font-family: serif;
background: yellow;
}
.pagedjsButton {
background-color: black;
text-transform: uppercase;
......@@ -27,7 +29,7 @@
window.pagedMakerConfig = {
content: ".bookContent",
stylesheet: "css/print.css",
button: undefined,
button: ".pagedjsButton",
features: [
"pagedSize",
"pagedMargins",
......@@ -36,8 +38,7 @@
"fontLineHeight",
"backgroundColor",
"textColor"
],
uicolor: "orange"
]
}
</script>
......
......@@ -11,6 +11,8 @@
<style>
.bookContent {
color: black;
font-size: serif;
background: yellow;
}
.pagedjsButton {
background-color: black;
......
......@@ -414,7 +414,7 @@ ${config_default.button == void 0 ? '<button class="pagedPreviewer-button-modal"
function toggleModal(modal) {
modal.classList.toggle("pagedPreviewer-hidden");
document.body.classList.remove("pagedPreviewer-blocked");
if (!document.querySelector(".pagedPreviewer-modal").classList.contains("hidden")) {
if (!document.querySelector(".pagedPreviewer-modal").classList.contains("pagedPreviewer-hidden")) {
document.body.classList.add("pagedPreviewer-blocked");
populatePagedMaker();
}
......
......@@ -14,7 +14,7 @@ window.onload = document.body.insertAdjacentHTML("afterbegin", ui);
document.querySelector("body").addEventListener("click", function (e) {
if (pagedMakerConfig.button != undefined) {
if (e.target === document.querySelector(`${pagedMakerConfig.button}`)) {
if (e.target === document.querySelector(`${pagedMakerConfig.button}`) ) {
toggleModal(document.querySelector(".pagedPreviewer-modal"));
}
}
......@@ -60,11 +60,11 @@ function toggleModal(modal) {
modal.classList.toggle("pagedPreviewer-hidden");
document.body.classList.remove("pagedPreviewer-blocked");
if (
!document.querySelector(".pagedPreviewer-modal").classList.contains("hidden")
!document.querySelector(".pagedPreviewer-modal").classList.contains("pagedPreviewer-hidden")
) {
document.body.classList.add("pagedPreviewer-blocked");
populatePagedMaker();
}
}
}
// populate the iframe
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment