From 4b025475dbd418b0b54c7001949b25a6c74a37fe Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 27 Nov 2024 18:27:54 +0100 Subject: [PATCH] bold open file --- static/js/cours.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/static/js/cours.js b/static/js/cours.js index 30ece9a..82cff88 100644 --- a/static/js/cours.js +++ b/static/js/cours.js @@ -102,6 +102,14 @@ window.addEventListener("load", () => { fileTreeElement.querySelector("ul").childNodes ); + // Bold opened file + const opened_file = fullpath.split("/").at(-1); + last_openeded.querySelector("ul").childNodes.forEach((el) => { + if (el.innerText === opened_file) { + el.style.fontWeight = "bold"; + } + }); + uncollapse(last_openeded); } });