From bbbdb494bfe126365e3b0be157397994e0de9e19 Mon Sep 17 00:00:00 2001 From: Mario Wehr Date: Mon, 24 Jul 2023 20:24:57 +0200 Subject: [PATCH] Improvement: Only add load OffCanvas module when offcanvas region is enabled, solves #343 --- CHANGES.md | 1 + templates/theme_boost/drawers.mustache | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0d3b08b0393..e4c9944069d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2023-07-24 - Improvement: Only add load OffCanvas module when offcanvas region is enabled, solves #343. * 2023-07-11 - Improvement: Place mustache templates which are overridden from theme_boost into subfolder, solves #337. * 2023-07-10 - Bugfix: Omit warning when no CSS cached folder present, solves #330. * 2023-07-10 - Bugfix: Overwriting module purposes did not affect all places where the activity icon is displayed, solves #318. diff --git a/templates/theme_boost/drawers.mustache b/templates/theme_boost/drawers.mustache index 8db9ef507ea..77b3b996eca 100644 --- a/templates/theme_boost/drawers.mustache +++ b/templates/theme_boost/drawers.mustache @@ -295,9 +295,9 @@ {{#js}} M.util.js_pending('theme_boost/loader'); -require(['theme_boost/loader', 'theme_boost/drawer', 'theme_boost_union/offcanvas'], function(Loader, Drawer, OffCanvas) { +require(['theme_boost/loader', 'theme_boost/drawer'{{#regions.offcanvas.hasblocks}},'theme_boost_union/offcanvas'{{/regions.offcanvas.hasblocks}}], function(Loader, Drawer{{#regions.offcanvas.hasblocks}},OffCanvas{{/regions.offcanvas.hasblocks}}) { Drawer.init(); M.util.js_complete('theme_boost/loader'); - OffCanvas.init(); + {{#regions.offcanvas.hasblocks}}OffCanvas.init();{{/regions.offcanvas.hasblocks}} }); {{/js}}