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");
|
li.classList.add("collapsed");
|
||||||
|
|
||||||
// Toggle collapsing on click
|
// Toggle collapsing on click
|
||||||
li.addEventListener("click", function (e) {
|
li.addEventListener(
|
||||||
if (e.target === li) {
|
"click",
|
||||||
li.classList.toggle("collapsed");
|
(e) => {
|
||||||
}
|
if (e.target === li) {
|
||||||
});
|
li.classList.toggle("collapsed");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ passive: true }
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
// File
|
// File
|
||||||
const url = window.location.href.split("?")[0];
|
const url = window.location.href.split("?")[0];
|
||||||
|
|
Loading…
Reference in a new issue