From ea7d962a177306d600080df715ea3dc5aa322ce7 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 28 Nov 2024 16:47:13 +0100 Subject: [PATCH] typos --- static/js/cours.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/static/js/cours.js b/static/js/cours.js index 13037a3..96ac8d5 100644 --- a/static/js/cours.js +++ b/static/js/cours.js @@ -98,7 +98,7 @@ const searchFiles = (query, parent, currentFile) => { return; } - for (const item in children) { + for (const item of children) { if (item.innerText.toLowerCase().includes(query.toLowerCase())) { item.style.display = ""; uncollapse(item); @@ -125,23 +125,24 @@ window.addEventListener("load", () => { if (infoURL.length > 1) { const fullpath = infoURL[1].substring(2); const path = fullpath.substring(0, fullpath.lastIndexOf("/")); - const currently_open = deepestNodeOpened( + + const currentlyOpen = deepestNodeOpened( path.split("/"), fileTreeElement.querySelector("ul").childNodes ); - uncollapse(currently_open); + uncollapse(currentlyOpen); // Bold opened file - const opened_file = fullpath.split("/").at(-1); - currently_open.querySelector("ul").childNodes.forEach((el) => { - if (el.innerText === opened_file) { + const openedFile = fullpath.split("/").at(-1); + currentlyOpen.querySelector("ul").childNodes.forEach((el) => { + if (el.innerText === openedFile) { el.style.fontWeight = "bold"; } }); // Search bar hook document.getElementById("searchBar").addEventListener("input", (e) => { - searchFiles(e.target.value, fileTreeElement, currently_open); + searchFiles(e.target.value, fileTreeElement, currentlyOpen); }); }