We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83d5b67 commit 4e1d551Copy full SHA for 4e1d551
src/components/PrintSyllabus.tsx
@@ -85,8 +85,12 @@ export const PrintSyllabus = ({ blockData }: { blockData: BlockResponse }) => {
85
const blocks = blockData?.blocks;
86
const rootBlock = blockData?.blocks[blockData.root];
87
const srcdoc = buildSyllabusForPrint(intl, blocks, rootBlock);
88
- var iframe = document.createElement('iframe');
+ const iframe = document.createElement('iframe');
89
iframe.setAttribute("style", "display:none");
90
+ document.body.appendChild(iframe);
91
+ iframe.contentWindow.open();
92
+ iframe.contentWindow.write(srcdoc);
93
+ iframe.contentWindow.close();
94
iframe.contentWindow.print();
95
};
96
0 commit comments