mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-12 18:32:44 +00:00
fix: open current folder in file tree
This commit is contained in:
@@ -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>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user