fix filetree
This commit is contained in:
parent
0404b84506
commit
67926e312b
1 changed files with 11 additions and 2 deletions
|
@ -93,7 +93,10 @@ const deepestNodeOpened = (path, options) => {
|
||||||
// Iterate over possible options
|
// Iterate over possible options
|
||||||
for (let i = 0; i < options.length; ++i) {
|
for (let i = 0; i < options.length; ++i) {
|
||||||
// If the directory and the current path match
|
// If the directory and the current path match
|
||||||
if (decodeURI(path[0]) === options[i].firstChild.nodeValue) {
|
if (
|
||||||
|
decodeURI(path[0]).toLowerCase() ===
|
||||||
|
options[i].firstChild.nodeValue.toLowerCase()
|
||||||
|
) {
|
||||||
if (path.length === 1) {
|
if (path.length === 1) {
|
||||||
// We found it
|
// We found it
|
||||||
return options[i];
|
return options[i];
|
||||||
|
@ -172,7 +175,13 @@ window.addEventListener("load", () => {
|
||||||
// Bold opened file
|
// Bold opened file
|
||||||
const openedFile = decodeURI(fullpath.split("/").at(-1));
|
const openedFile = decodeURI(fullpath.split("/").at(-1));
|
||||||
currentlyOpen.querySelector("ul").childNodes.forEach((el) => {
|
currentlyOpen.querySelector("ul").childNodes.forEach((el) => {
|
||||||
if (el.innerText === openedFile) {
|
const elementToCompare = decodeURI(
|
||||||
|
el.firstChild.search
|
||||||
|
? el.firstChild.search.substring(3).split("/").at(-1)
|
||||||
|
: el.firstChild.data
|
||||||
|
);
|
||||||
|
|
||||||
|
if (elementToCompare === openedFile) {
|
||||||
el.style.fontWeight = "bold";
|
el.style.fontWeight = "bold";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue