Gespeicherte Portalnavigation beim Reload wiederherstellen
This commit is contained in:
1 parent
7fc75eaee6
commit
6750d4778f
1 file changed
+7
-8
@@ -960,7 +960,7 @@ function render_auth_home_page(array $user, array $otcProducts = [], array $otcM
|
|||||||
echo " button.type = 'button';";
|
echo " button.type = 'button';";
|
||||||
echo " button.setAttribute('role', 'tab');";
|
echo " button.setAttribute('role', 'tab');";
|
||||||
echo " button.setAttribute('data-component-part', 'tab-button');";
|
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 " button.textContent = entry;";
|
||||||
echo " menu.appendChild(button);";
|
echo " menu.appendChild(button);";
|
||||||
echo " });";
|
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 " otherButton.setAttribute('aria-selected', String(otherButton === button));";
|
||||||
echo " });";
|
echo " });";
|
||||||
echo " const entryName = button.textContent.trim();";
|
echo " const entryName = button.textContent.trim();";
|
||||||
|
echo " updatePortalLocation(moduleName, entryName);";
|
||||||
echo " if (contentTitle) { contentTitle.textContent = entryName; }";
|
echo " if (contentTitle) { contentTitle.textContent = entryName; }";
|
||||||
echo " if (contentSection) { contentSection.setAttribute('aria-hidden', 'false'); }";
|
echo " if (contentSection) { contentSection.setAttribute('aria-hidden', 'false'); }";
|
||||||
echo " if (contentBody) { contentBody.innerHTML = portalModuleContentCards[entryName] || ''; }";
|
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 === 'Marktdurchführungen') { initMarketsBindings(); }";
|
||||||
echo " if (entryName === 'Märkte') { initMarketDefinitionsBindings(); }";
|
echo " if (entryName === 'Märkte') { initMarketDefinitionsBindings(); }";
|
||||||
echo " if (entryName === 'Lager' || entryName === 'Artikel') { initLagerBindings(); }";
|
echo " if (entryName === 'Lager' || entryName === 'Artikel') { initLagerBindings(); }";
|
||||||
echo " updatePortalLocation(moduleName, entryName);";
|
|
||||||
echo " });";
|
echo " });";
|
||||||
echo " });";
|
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.setAttribute('aria-selected', String(isActive));";
|
||||||
echo " otherButton.dataset.componentState = isActive ? 'active' : 'inactive';";
|
echo " otherButton.dataset.componentState = isActive ? 'active' : 'inactive';";
|
||||||
echo " });";
|
echo " });";
|
||||||
echo " renderMainHeading(button.textContent.trim());";
|
echo " const moduleName = button.textContent.trim();";
|
||||||
echo " renderLeftNavigation(button.textContent.trim());";
|
echo " updatePortalLocation(moduleName);";
|
||||||
echo " updatePortalLocation(button.textContent.trim());";
|
echo " renderMainHeading(moduleName);";
|
||||||
|
echo " renderLeftNavigation(moduleName);";
|
||||||
echo " });";
|
echo " });";
|
||||||
echo " });";
|
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 "document.querySelectorAll('.sg-sandwich-menu-wrap').forEach((wrap) => {";
|
||||||
echo " const button = wrap.querySelector('.sg-sandwich-button');";
|
echo " const button = wrap.querySelector('.sg-sandwich-button');";
|
||||||
echo " button.addEventListener('click', (event) => {";
|
echo " button.addEventListener('click', (event) => {";
|
||||||
@@ -1895,8 +1895,7 @@ JS;
|
|||||||
echo " outsideClickIgnoreSelectors: ['.sg-sandwich-menu-wrap'],";
|
echo " outsideClickIgnoreSelectors: ['.sg-sandwich-menu-wrap'],";
|
||||||
echo " });";
|
echo " });";
|
||||||
echo "}";
|
echo "}";
|
||||||
echo "renderMainHeading('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 "renderLeftNavigation('ERP');";
|
|
||||||
echo '</script>';
|
echo '</script>';
|
||||||
echo '</body>';
|
echo '</body>';
|
||||||
echo '</html>';
|
echo '</html>';
|
||||||
|
|||||||
Reference in new issue
Block a user