1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 23:20:51 +00:00

improve tree loading for Wiki mode (#2842)

This commit is contained in:
杨顺强
2019-01-23 16:25:14 +08:00
committed by Daniel Pan
parent 4b4233ebb9
commit 123a442319
19 changed files with 1386 additions and 601 deletions

View File

@@ -171,7 +171,21 @@ export const Utils = {
return filePath.slice(lastIndex+1);
},
/**
/**
* input: '/abc/bc/cb'
* output: ['/abc', '/abc/bc', '/abc/bc/cb'];
*/
getPaths: function(path) {
let paths = path.split('/').slice(1);
let result = [];
while(paths.length) {
result.push('/' + paths.join('/'));
paths.pop();
}
return result.reverse();
},
/**
* input:
* eg: /
* ../abc/abc/