fix: open current folder in file tree

This commit is contained in:
tdurieux
2021-09-12 09:21:12 +02:00
parent 816f381b9b
commit b5c3c41386

View File

@@ -193,6 +193,13 @@ angular
$scope.repoId = document.location.pathname.split("/")[2];
$scope.opens = {};
let accumulatedPath = "";
$routeParams.path.split("/").forEach((f) => {
$scope.opens[accumulatedPath + "/" + f] = true;
accumulatedPath = accumulatedPath + "/" + f;
});
const toArray = function (obj) {
const output = [];
for (let name in obj) {
@@ -258,6 +265,9 @@ angular
} else {
output += `<a href='/r/${$scope.repoId}${path}'>${name}</a>`;
}
if ($scope.opens[path]) {
output += generate(f.child, parentPath + "/" + f.name);
}
// output += generate(f.child, parentPath + "/" + f.name);
output + "</li>";
}