From bf13da917849c178939c98e2d238a4b73c2d580d Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 12 Dec 2024 16:41:28 +0100 Subject: [PATCH] passive optimization --- static/js/cours.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/static/js/cours.js b/static/js/cours.js index f959d60..6537fad 100644 --- a/static/js/cours.js +++ b/static/js/cours.js @@ -19,11 +19,15 @@ const buildFileTree = (parent, data, location) => { li.classList.add("collapsed"); // Toggle collapsing on click - li.addEventListener("click", function (e) { - if (e.target === li) { - li.classList.toggle("collapsed"); - } - }); + li.addEventListener( + "click", + (e) => { + if (e.target === li) { + li.classList.toggle("collapsed"); + } + }, + { passive: true } + ); } else { // File const url = window.location.href.split("?")[0];