From 0a1a258e24d59908a876dd55c37d9ae29dea8597 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 28 Nov 2024 17:11:40 +0100 Subject: [PATCH] fix for root element --- static/js/cours.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/js/cours.js b/static/js/cours.js index 96ac8d5..0ecc1d8 100644 --- a/static/js/cours.js +++ b/static/js/cours.js @@ -62,6 +62,10 @@ const uncollapse = (element) => { * @returns */ const deepestNodeOpened = (path, options) => { + if (path[0] === "") { + return options[0].parentNode.parentNode; + } + // Iterate over possible options for (let i = 0; i < options.length; ++i) { // If the directory and the current path match