Gespeicherte Portalnavigation beim Reload wiederherstellen

This commit is contained in:
gitea_admin committed 2026-09-20 13:18:26 +02:00
1 parent 7fc75eaee6
commit 6750d4778f
1 file changed
+7 -8
+7 -8
View File
@@ -960,7 +960,7 @@ function render_auth_home_page(array $user, array $otcProducts = [], array $otcM
echo " button.type = 'button';";
echo " button.setAttribute('role', 'tab');";
echo " button.setAttribute('data-component-part', 'tab-button');";
echo " button.setAttribute('aria-selected', String(index === 0));";
echo " button.setAttribute('aria-selected', String(entry === activeEntry));";
echo " button.textContent = entry;";
echo " menu.appendChild(button);";
echo " });";
@@ -970,6 +970,7 @@ function render_auth_home_page(array $user, array $otcProducts = [], array $otcM
echo " otherButton.setAttribute('aria-selected', String(otherButton === button));";
echo " });";
echo " const entryName = button.textContent.trim();";
echo " updatePortalLocation(moduleName, entryName);";
echo " if (contentTitle) { contentTitle.textContent = entryName; }";
echo " if (contentSection) { contentSection.setAttribute('aria-hidden', 'false'); }";
echo " if (contentBody) { contentBody.innerHTML = portalModuleContentCards[entryName] || ''; }";
@@ -977,7 +978,6 @@ function render_auth_home_page(array $user, array $otcProducts = [], array $otcM
echo " if (entryName === 'Marktdurchführungen') { initMarketsBindings(); }";
echo " if (entryName === 'Märkte') { initMarketDefinitionsBindings(); }";
echo " if (entryName === 'Lager' || entryName === 'Artikel') { initLagerBindings(); }";
echo " updatePortalLocation(moduleName, entryName);";
echo " });";
echo " });";
echo "};";
@@ -989,13 +989,13 @@ function render_auth_home_page(array $user, array $otcProducts = [], array $otcM
echo " otherButton.setAttribute('aria-selected', String(isActive));";
echo " otherButton.dataset.componentState = isActive ? 'active' : 'inactive';";
echo " });";
echo " renderMainHeading(button.textContent.trim());";
echo " renderLeftNavigation(button.textContent.trim());";
echo " updatePortalLocation(button.textContent.trim());";
echo " const moduleName = button.textContent.trim();";
echo " updatePortalLocation(moduleName);";
echo " renderMainHeading(moduleName);";
echo " renderLeftNavigation(moduleName);";
echo " });";
echo " });";
echo "});";
echo "(() => { const url = new URL(window.location.href); const requestedModule = url.searchParams.get('portal_module') || 'ERP'; const moduleButton = Array.from(document.querySelectorAll('.sg-portal-header__tabs .sg-tab-button')).find((button) => button.textContent.trim() === requestedModule) || document.querySelector('.sg-portal-header__tabs .sg-tab-button'); if (!moduleButton) { return; } const moduleName = moduleButton.textContent.trim(); document.querySelectorAll('.sg-portal-header__tabs .sg-tab-button').forEach((button) => { const active = button === moduleButton; button.setAttribute('aria-selected', String(active)); button.dataset.componentState = active ? 'active' : 'inactive'; }); renderMainHeading(moduleName); renderLeftNavigation(moduleName, url.searchParams.get('portal_section') || ''); })();";
echo "document.querySelectorAll('.sg-sandwich-menu-wrap').forEach((wrap) => {";
echo " const button = wrap.querySelector('.sg-sandwich-button');";
echo " button.addEventListener('click', (event) => {";
@@ -1895,8 +1895,7 @@ JS;
echo " outsideClickIgnoreSelectors: ['.sg-sandwich-menu-wrap'],";
echo " });";
echo "}";
echo "renderMainHeading('ERP');";
echo "renderLeftNavigation('ERP');";
echo "(() => { const url = new URL(window.location.href); const requestedModule = url.searchParams.get('portal_module') || 'ERP'; const moduleButton = Array.from(document.querySelectorAll('.sg-portal-header__tabs .sg-tab-button')).find((button) => button.textContent.trim() === requestedModule) || document.querySelector('.sg-portal-header__tabs .sg-tab-button'); if (!moduleButton) { return; } const moduleName = moduleButton.textContent.trim(); document.querySelectorAll('.sg-portal-header__tabs .sg-tab-button').forEach((button) => { const active = button === moduleButton; button.setAttribute('aria-selected', String(active)); button.dataset.componentState = active ? 'active' : 'inactive'; }); renderMainHeading(moduleName); renderLeftNavigation(moduleName, url.searchParams.get('portal_section') || ''); })();";
echo '</script>';
echo '</body>';
echo '</html>';