diff --git a/css/print.css b/css/print.css index a4f6180b..6e3df1e5 100644 --- a/css/print.css +++ b/css/print.css @@ -190,12 +190,41 @@ page-break-after: always; } +/* Styles for web users who wish to print (or "print") the document */ +#shortcuts-help, +#menu-toggle, +#menu-spacer, +#menu-search, +#menu-pins { + display: none; +} +#menu-toc { + display: block; + overflow: visible; +} +#menu { + background: none; + border: none; + display: block; + height: initial; + max-width: 100%; + overflow: initial; + position: static; + transition: none; + width: initial; +} +.menu-pane-header { + background: none; + font-size: initial; +} + html, body { background-color: initial; } body { + display: block; font-family: 'Arial Plus', Arial, Helvetica, sans-serif, 'DejaVu Math TeX Gyre', Symbola, monospace; font-size: 10pt; diff --git a/js/sdoMap.js b/js/sdoMap.js index 2e8d051e..22eb6579 100644 --- a/js/sdoMap.js +++ b/js/sdoMap.js @@ -80,3 +80,15 @@ document.addEventListener('DOMContentLoaded', () => { }), ); }); + +window.addEventListener('beforeprint', () => { + if (!document.body.classList.contains('oldtoc')) { + document.getElementById('metadata-block').before(document.getElementById('menu')); + } +}); + +window.addEventListener('afterprint', () => { + if (!document.body.classList.contains('oldtoc')) { + document.getElementById('spec-container').before(document.getElementById('menu')); + } +}); diff --git a/test/baselines/generated-reference/assets-inline.html b/test/baselines/generated-reference/assets-inline.html index 3181389c..c4971e94 100644 --- a/test/baselines/generated-reference/assets-inline.html +++ b/test/baselines/generated-reference/assets-inline.html @@ -82,6 +82,18 @@ ); }); +window.addEventListener('beforeprint', () => { + if (!document.body.classList.contains('oldtoc')) { + document.getElementById('metadata-block').before(document.getElementById('menu')); + } +}); + +window.addEventListener('afterprint', () => { + if (!document.body.classList.contains('oldtoc')) { + document.getElementById('spec-container').before(document.getElementById('menu')); + } +}); + 'use strict'; // Duplicates multipage.js for fault tolerance. @@ -3544,12 +3556,41 @@ page-break-after: always; } +/* Styles for web users who wish to print (or "print") the document */ +#shortcuts-help, +#menu-toggle, +#menu-spacer, +#menu-search, +#menu-pins { + display: none; +} +#menu-toc { + display: block; + overflow: visible; +} +#menu { + background: none; + border: none; + display: block; + height: initial; + max-width: 100%; + overflow: initial; + position: static; + transition: none; + width: initial; +} +.menu-pane-header { + background: none; + font-size: initial; +} + html, body { background-color: initial; } body { + display: block; font-family: 'Arial Plus', Arial, Helvetica, sans-serif, 'DejaVu Math TeX Gyre', Symbola, monospace; font-size: 10pt;