Load overlay helper globally

This commit is contained in:
2026-06-15 13:55:32 +02:00
parent b9cd92e221
commit 2a6487aae9
4 changed files with 205 additions and 0 deletions
+1
View File
@@ -275,6 +275,7 @@
</style>
</head>
<body>
<script src="/scripts/help-icon-overlays.js"></script>
<div class="container">
<h1>OTC-Verkauf</h1>
+17
View File
@@ -193,6 +193,7 @@ function render_auth_home_page(array $user, array $otcProducts = []): void
echo '</div>';
echo '</article>';
echo '</section>';
echo '<script src="/scripts/help-icon-overlays.js"></script>';
echo '<script>';
echo 'const portalModuleNavigation = ' . $moduleNavigation . ';';
echo 'const portalModuleContentCards = ' . $moduleContentCards . ';';
@@ -261,6 +262,16 @@ function render_auth_home_page(array $user, array $otcProducts = []): void
echo " button.setAttribute('aria-expanded', String(nextState));";
echo " });";
echo "});";
echo "document.addEventListener('click', (event) => {";
echo " if (event.target.closest('.sg-sandwich-menu-wrap')) {";
echo " return;";
echo " }";
echo " document.querySelectorAll('.sg-sandwich-menu-wrap').forEach((wrap) => {";
echo " const button = wrap.querySelector('.sg-sandwich-button');";
echo " wrap.dataset.open = 'false';";
echo " if (button) { button.setAttribute('aria-expanded', 'false'); }";
echo " });";
echo "});";
echo "(() => {";
echo " const mediaQuery = window.matchMedia('(max-width: 767px)');";
echo " const toggle = document.querySelector('[data-left-navigation-toggle]');";
@@ -475,6 +486,12 @@ function render_auth_home_page(array $user, array $otcProducts = []): void
echo " });";
echo " updateFormState();";
echo "})();";
echo "if (window.sgInitHelpIconOverlays) {";
echo " window.sgInitHelpIconOverlays({";
echo " closeOnOpenSelectors: ['.sg-sandwich-menu-wrap'],";
echo " outsideClickIgnoreSelectors: ['.sg-sandwich-menu-wrap'],";
echo " });";
echo "}";
echo "renderMainHeading('ERP');";
echo "renderLeftNavigation('ERP');";
echo '</script>';
+1
View File
@@ -25,6 +25,7 @@ function render_auth_login_page(array $state): void
echo '<link rel="stylesheet" href="/assets/styles.css">';
echo '</head>';
echo '<body class="sg-vsf-register-step-1-page">';
echo '<script src="/scripts/help-icon-overlays.js"></script>';
echo '<main class="sg-vsf-register-step-1">';
echo '<article class="sg-card sg-object-card sg-object-card--variable-height sg-vsf-register-step-1__card" data-pattern="object-card" aria-label="Anmeldung">';