From de3799637077befae5616dd06207de34b855a068 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Tue, 19 May 2020 04:46:34 +0200 Subject: [PATCH] Fix loaded service indicator disappearing when modifying navigation --- resources/js/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/resources/js/index.js b/resources/js/index.js index 7a43886..6ecf956 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -555,11 +555,14 @@ function updateNavigation() { // Update active list element for (let i = 0; i < services.length; i++) { const service = services[i]; - if (parseInt(selectedService) === i) { - service.li.classList.add('active'); - } else { - service.li.classList.remove('active'); - } + + // Active? + if (parseInt(selectedService) === i) service.li.classList.add('active'); + else service.li.classList.remove('active'); + + // Loaded? + if (service.viewReady) service.li.classList.add('loaded'); + else service.li.classList.remove('loaded'); } if (selectedService !== null && services[selectedService].viewReady) {