From 5b77b0b524a04c41bb764e5436fecbd4599f7219 Mon Sep 17 00:00:00 2001 From: patrickzerhusen Date: Tue, 28 Apr 2026 15:32:24 +0200 Subject: [PATCH] page tab in moderation portal saved for persistence after reload --- public/admin.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/public/admin.php b/public/admin.php index 8da4f3c..728d780 100644 --- a/public/admin.php +++ b/public/admin.php @@ -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'; });