This commit is contained in:
Andrea Vos 2025-09-16 20:51:17 +02:00
parent de13ddbf5c
commit 76aaf672cb

View File

@ -94,17 +94,17 @@ onMounted(executeUnlessPrerendering(() => {
};
// making census reports print-friendly
window.addEventListener("beforeprint", () => {
document.querySelectorAll("iframe[loading=lazy]").forEach(iframe => {
iframe.removeAttribute("loading");
iframe.setAttribute("src", iframe.getAttribute("src")!);
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 => {
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";
graph.style.width = '718px'; // A4 width - 1cm margins at 96dpi
graph.style.height = '400px';
});
document.querySelectorAll("details").forEach(d => d.setAttribute("open", ""));
document.querySelectorAll('details').forEach((d) => d.setAttribute('open', ''));
});
}));