Fix: Apply translations after sidebar load to resolve 'sidebar.screen' display issue
This commit is contained in:
@@ -121,14 +121,15 @@
|
||||
const element = document.getElementById(id);
|
||||
if (element) {
|
||||
element.innerHTML = data;
|
||||
// Ensure the screen tab is visible here as well if we are on this page,
|
||||
// though index.html handles it globally, sidebar load might reset it.
|
||||
// Ideally sidebar logic should be consistent.
|
||||
// For now, if we are ON screen.html, we should show the nav item.
|
||||
// Apply translations after loading dynamic content
|
||||
if (window.i18n && typeof window.i18n.applyTranslations === 'function') {
|
||||
window.i18n.applyTranslations();
|
||||
}
|
||||
// Ensure the screen tab is visible here as well
|
||||
if (id.includes('sidebar')) {
|
||||
setTimeout(() => {
|
||||
const navScreen = element.querySelector('#nav-screen');
|
||||
if (navScreen) navScreen.style.display = 'flex'; // or block
|
||||
const navScreenElements = element.querySelectorAll('.nav-screen-item');
|
||||
navScreenElements.forEach(el => el.style.display = 'flex');
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user