page tab in moderation portal saved for persistence after reload
This commit is contained in:
@@ -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';
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user