mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-07 22:28:01 +02: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.repoId = document.location.pathname.split("/")[2];
|
||||||
|
|
||||||
$scope.opens = {};
|
$scope.opens = {};
|
||||||
|
|
||||||
|
let accumulatedPath = "";
|
||||||
|
$routeParams.path.split("/").forEach((f) => {
|
||||||
|
$scope.opens[accumulatedPath + "/" + f] = true;
|
||||||
|
accumulatedPath = accumulatedPath + "/" + f;
|
||||||
|
});
|
||||||
|
|
||||||
const toArray = function (obj) {
|
const toArray = function (obj) {
|
||||||
const output = [];
|
const output = [];
|
||||||
for (let name in obj) {
|
for (let name in obj) {
|
||||||
@@ -258,6 +265,9 @@ angular
|
|||||||
} else {
|
} else {
|
||||||
output += `<a href='/r/${$scope.repoId}${path}'>${name}</a>`;
|
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 += generate(f.child, parentPath + "/" + f.name);
|
||||||
output + "</li>";
|
output + "</li>";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user