From 242997744d052e3e01d3ec00748db1950c63e097 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Mon, 21 Nov 2016 12:52:09 +0800 Subject: [PATCH] MDL-56995 boost: Hide navigation for print media Hide the navigation elements, flat navigation settings menus etc when printing. --- theme/boost/scss/moodle.scss | 1 + theme/boost/scss/moodle/core.scss | 1 + theme/boost/scss/moodle/print.scss | 14 ++++++++++++++ theme/boost/templates/columns2.mustache | 4 ++-- theme/boost/templates/nav-drawer.mustache | 2 +- 5 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 theme/boost/scss/moodle/print.scss diff --git a/theme/boost/scss/moodle.scss b/theme/boost/scss/moodle.scss index d14fc5fc128..5ac0c0d583d 100644 --- a/theme/boost/scss/moodle.scss +++ b/theme/boost/scss/moodle.scss @@ -41,3 +41,4 @@ $breadcrumb-divider-rtl: "◀" !default; @import "moodle/tool_usertours"; @import "moodle/responsive-tabs"; @import "moodle/bs2-compat"; +@import "moodle/print"; diff --git a/theme/boost/scss/moodle/core.scss b/theme/boost/scss/moodle/core.scss index bfe738f1ca8..b3345724281 100644 --- a/theme/boost/scss/moodle/core.scss +++ b/theme/boost/scss/moodle/core.scss @@ -2168,3 +2168,4 @@ $footer-link-color: $brand-primary !default; padding-left: 1.5rem; } } + diff --git a/theme/boost/scss/moodle/print.scss b/theme/boost/scss/moodle/print.scss new file mode 100644 index 00000000000..16ade3599df --- /dev/null +++ b/theme/boost/scss/moodle/print.scss @@ -0,0 +1,14 @@ +@media print { + // Fix body margin for drawer in print mode. + body.drawer-open-left.jsenabled, + body.drawer-open-right.jsenabled { + margin: 0px; + } + + // Safari fix see: http://v4-alpha.getbootstrap.com/getting-started/browsers-devices/#printing. + .container { + width: auto; + } +} + + diff --git a/theme/boost/templates/columns2.mustache b/theme/boost/templates/columns2.mustache index 682c3fc25c9..2a7758c6ef6 100644 --- a/theme/boost/templates/columns2.mustache +++ b/theme/boost/templates/columns2.mustache @@ -71,7 +71,7 @@
{{#hasregionmainsettingsmenu}} -
+
{{{ output.region_main_settings_menu }}}
{{/hasregionmainsettingsmenu}} @@ -86,7 +86,7 @@
{{#hasblocks}} -
+
{{{ sidepreblocks }}}
{{/hasblocks}} diff --git a/theme/boost/templates/nav-drawer.mustache b/theme/boost/templates/nav-drawer.mustache index 3b7573092f3..74388ec1062 100644 --- a/theme/boost/templates/nav-drawer.mustache +++ b/theme/boost/templates/nav-drawer.mustache @@ -1,3 +1,3 @@ -