Load overlay helper globally
This commit is contained in:
@@ -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>';
|
||||
|
||||
@@ -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">';
|
||||
|
||||
Reference in New Issue
Block a user