page tab in moderation portal saved for persistence after reload

This commit is contained in:
2026-04-28 15:32:24 +02:00
parent bc37051619
commit 5b77b0b524

View File

@@ -513,13 +513,25 @@ $counts['total'] = count($all_contributions);
// Current Status Filter
let currentFilter = 'all';
// Restores active Tab after Page Reload
const savedTab = sessionStorage.getItem('admin_active_tab');
if (savedTab) {
// Delays to ensure DOM is ready
setTimeout(function () {
const tabBtn = document.querySelector('.page-tab[onclick*="' + savedTab + '"]');
if (tabBtn) tabBtn.click();
}, 100);
}
// =============================================================
// Page Tab Navigation
// =============================================================
function showPageTab(tabName) {
// Hides all Tab Contents
// Saves active Tab for Persistence after Reload
sessionStorage.setItem('admin_active_tab', tabName);
document.querySelectorAll('.page-tab-content').forEach(function (el) {
el.style.display = 'none';
});