mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-23 04:34:15 -04:00
(pl)(spis) make census more print-friendly
This commit is contained in:
parent
ea3b6a360e
commit
de13ddbf5c
@ -5,8 +5,8 @@
|
||||
display: none;
|
||||
}
|
||||
body {
|
||||
background: none;
|
||||
background-color: $white;
|
||||
background: none !important;
|
||||
color: $black !important;
|
||||
}
|
||||
hr {
|
||||
display: block;
|
||||
@ -16,4 +16,16 @@
|
||||
@page {
|
||||
margin: 1cm;
|
||||
}
|
||||
|
||||
details {
|
||||
break-inside: avoid;
|
||||
margin-bottom: 1em;
|
||||
p {
|
||||
margin: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
th, td {
|
||||
color: $black !important;
|
||||
}
|
||||
}
|
||||
|
@ -92,6 +92,20 @@ onMounted(executeUnlessPrerendering(() => {
|
||||
window.location.reload();
|
||||
}
|
||||
};
|
||||
|
||||
// making census reports print-friendly
|
||||
window.addEventListener("beforeprint", () => {
|
||||
document.querySelectorAll("iframe[loading=lazy]").forEach(iframe => {
|
||||
iframe.removeAttribute("loading");
|
||||
iframe.setAttribute("src", iframe.getAttribute("src")!);
|
||||
});
|
||||
document.querySelectorAll("iframe.graph").forEach(iframe => {
|
||||
const graph = iframe as HTMLIFrameElement;
|
||||
graph.style.width = "718px"; // A4 width - 1cm margins at 96dpi
|
||||
graph.style.height = "400px";
|
||||
});
|
||||
document.querySelectorAll("details").forEach(d => d.setAttribute("open", ""));
|
||||
});
|
||||
}));
|
||||
|
||||
const dialogue = useDialogue();
|
||||
|
Loading…
x
Reference in New Issue
Block a user