diff --git a/frontend/global-styles/index.scss b/frontend/global-styles/index.scss index db7b98ca5..b61bd7742 100644 --- a/frontend/global-styles/index.scss +++ b/frontend/global-styles/index.scss @@ -17,6 +17,7 @@ @import "./github-markdown"; @import "./markdown-tweaks"; @import "./reveal"; +@import "./print"; .text-black, body[data-bs-theme=dark] .text-black { color: $black; diff --git a/frontend/global-styles/print.scss b/frontend/global-styles/print.scss new file mode 100644 index 000000000..7d9857f3d --- /dev/null +++ b/frontend/global-styles/print.scss @@ -0,0 +1,10 @@ +/*! + * SPDX-FileCopyrightText: 2024 The HedgeDoc developers (see AUTHORS file) + * + * SPDX-License-Identifier: AGPL-3.0-only + */ +@media print { + .heading-anchor { + display: none; + } +} diff --git a/frontend/src/components/editor-page/utils/print-iframe.ts b/frontend/src/components/editor-page/utils/print-iframe.ts index 51ffad7b5..ae7012aef 100644 --- a/frontend/src/components/editor-page/utils/print-iframe.ts +++ b/frontend/src/components/editor-page/utils/print-iframe.ts @@ -9,7 +9,11 @@ */ export const printIframe = (): void => { const iframe = document.getElementById('editor-renderer-iframe') as HTMLIFrameElement +<<<<<<< HEAD if (!iframe) { +======= + if (!iframe || !iframe.contentWindow) { +>>>>>>> 279f6cd89 (feat(frontend): add basic print functionality) return } iframe.contentWindow.print() diff --git a/frontend/src/components/render-page/markdown-toc-button/markdown-toc-button.module.scss b/frontend/src/components/render-page/markdown-toc-button/markdown-toc-button.module.scss index c54f12886..74e1a3d5c 100644 --- a/frontend/src/components/render-page/markdown-toc-button/markdown-toc-button.module.scss +++ b/frontend/src/components/render-page/markdown-toc-button/markdown-toc-button.module.scss @@ -15,3 +15,9 @@ right: 0; } } + +@media print { + .markdown-toc-sidebar-button { + display: none; + } +}