passive optimization
This commit is contained in:
parent
52e3674140
commit
bf13da9178
1 changed files with 9 additions and 5 deletions
|
@ -19,11 +19,15 @@ const buildFileTree = (parent, data, location) => {
|
|||
li.classList.add("collapsed");
|
||||
|
||||
// Toggle collapsing on click
|
||||
li.addEventListener("click", function (e) {
|
||||
li.addEventListener(
|
||||
"click",
|
||||
(e) => {
|
||||
if (e.target === li) {
|
||||
li.classList.toggle("collapsed");
|
||||
}
|
||||
});
|
||||
},
|
||||
{ passive: true }
|
||||
);
|
||||
} else {
|
||||
// File
|
||||
const url = window.location.href.split("?")[0];
|
||||
|
|
Loading…
Reference in a new issue