typos
This commit is contained in:
parent
89ee05487c
commit
ea7d962a17
1 changed files with 8 additions and 7 deletions
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue