From d97233eea9917f93d4d9ad01694210bb1cbcb59d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 30 Jan 2026 05:54:06 +0000 Subject: [PATCH] Implement smart Bootstrap loading and fix drawer functionality Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com> --- src/templates/error.php | 6 ++++++ src/templates/index.php | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/templates/error.php b/src/templates/error.php index 5752d46..7f11193 100644 --- a/src/templates/error.php +++ b/src/templates/error.php @@ -87,6 +87,12 @@ try { // Scripts $wa->useScript('template.js'); +// Smart Bootstrap component loading - only load what's needed +if ($this->countModules('drawer-left', true) || $this->countModules('drawer-right', true)) { + // Load Bootstrap Offcanvas component for drawers + HTMLHelper::_('bootstrap.offcanvas'); +} + // Meta $this->setMetaData('viewport', 'width=device-width, initial-scale=1'); diff --git a/src/templates/index.php b/src/templates/index.php index c64baa1..0b19445 100644 --- a/src/templates/index.php +++ b/src/templates/index.php @@ -205,6 +205,12 @@ if ($this->countModules('sidebar-right', true)) { $hasClass .= ' has-sidebar-rig if ($this->countModules('drawer-left', true)) { $hasClass .= ' has-drawer-left'; } if ($this->countModules('drawer-right', true)) { $hasClass .= ' has-drawer-right'; } +// Smart Bootstrap component loading - only load what's needed +if ($this->countModules('drawer-left', true) || $this->countModules('drawer-right', true)) { + // Load Bootstrap Offcanvas component for drawers + HTMLHelper::_('bootstrap.offcanvas'); +} + // Container $wrapper = $this->params->get('fluidContainer') ? 'wrapper-fluid' : 'wrapper-static'; $stickyHeader = $this->params->get('stickyHeader') ? 'position-sticky sticky-top' : '';