This commit is contained in:
parent
61015a2536
commit
7fc3f95dd5
1 changed files with 2 additions and 5 deletions
|
@ -65,20 +65,17 @@ const deepestNodeOpened = (path, options) => {
|
|||
// Iterate over possible options
|
||||
for (let i = 0; i < options.length; ++i) {
|
||||
// If the directory and the current path match
|
||||
if (path[0] === options[i].firstChild.nodeValue) {
|
||||
if (decodeURI(path[0]) === options[i].firstChild.nodeValue) {
|
||||
if (path.length === 1) {
|
||||
// We found it
|
||||
return options[i];
|
||||
}
|
||||
|
||||
// Continue the search
|
||||
let returned_value = deepestNodeOpened(
|
||||
return deepestNodeOpened(
|
||||
path.slice(1),
|
||||
options[i].querySelector("ul").childNodes
|
||||
);
|
||||
if (returned_value) {
|
||||
return returned_value;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue