From 7b0fb0650abca3ba4a6d0b168adc9c7c623f2e78 Mon Sep 17 00:00:00 2001 From: PaulVua Date: Tue, 17 Feb 2026 12:23:19 +0100 Subject: [PATCH] Fix Screen tab visibility: Use class selector to handle multiple sidebar instances --- html/assets/js/topbar-logo.js | 29 +++---- html/index.html | 6 +- html/sidebar.html | 143 +++++++++++++++++++--------------- 3 files changed, 99 insertions(+), 79 deletions(-) diff --git a/html/assets/js/topbar-logo.js b/html/assets/js/topbar-logo.js index a599dcc..ba2293a 100644 --- a/html/assets/js/topbar-logo.js +++ b/html/assets/js/topbar-logo.js @@ -37,21 +37,22 @@ document.addEventListener('DOMContentLoaded', () => { } } - // 2. Sidebar Screen Tab Logic - const navScreen = document.getElementById('nav-screen'); - if (navScreen) { - if (isModuleAirPro) { - // Ensure it's visible (bootstrap nav-link usually block or flex) - // Using removeProperty to let CSS/Bootstrap handle it, or force display - if (navScreen.style.display === 'none') { - navScreen.style.display = 'flex'; + // 2. Sidebar Screen Tab Logic - Use class since ID might be duplicated (desktop/mobile) + const navScreenElements = document.querySelectorAll('.nav-screen-item'); + if (navScreenElements.length > 0) { + navScreenElements.forEach(navScreen => { + if (isModuleAirPro) { + // Ensure it's visible (bootstrap nav-link usually block or flex) + if (navScreen.style.display === 'none') { + navScreen.style.display = 'flex'; + } + } else { + // Hide if not pro + if (navScreen.style.display !== 'none') { + navScreen.style.display = 'none'; + } } - } else { - // Hide if not pro - if (navScreen.style.display !== 'none') { - navScreen.style.display = 'none'; - } - } + }); } } }); diff --git a/html/index.html b/html/index.html index 2aa940e..5c495e2 100755 --- a/html/index.html +++ b/html/index.html @@ -84,7 +84,8 @@ id="disk_size"> Gb)

Utilisation de la mémoire (taille totale - Mb)

+ Mb) +

Taille de la base de données:

@@ -175,7 +176,8 @@ // Check for device type to show Screen tab // Assuming the key in config is 'device_type' or 'type' if (response.device_type === 'moduleair_pro' || response.type === 'moduleair_pro') { - $('#nav-screen').show(); + $('.nav-screen-item').show(); + $('.nav-screen-item').css('display', 'flex'); // Ensure flex display to match others } }, diff --git a/html/sidebar.html b/html/sidebar.html index 2c07391..10d65d6 100755 --- a/html/sidebar.html +++ b/html/sidebar.html @@ -1,47 +1,60 @@ - - \ No newline at end of file