1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 16:31:13 +00:00

update list wiki dir (#2909)

This commit is contained in:
C_Q
2019-01-30 11:48:15 +08:00
committed by Daniel Pan
parent 68ea300225
commit 362f673f35
10 changed files with 90 additions and 61 deletions

View File

@@ -183,6 +183,7 @@ class Wiki extends Component {
}
loadSidePanel = (initialPath) => {
if (initialPath === '/' || isDir === 'None') {
seafileAPI.listDir(repoID, '/').then(res => {
let tree = this.state.treeData;
@@ -207,7 +208,7 @@ class Wiki extends Component {
});
// update location url
let url = siteRoot + 'wiki/lib/' + repoID + path;
let url = siteRoot + 'wiki/lib/' + repoID + Utils.encodePath(path);
window.history.pushState({ url: url, path: path}, path, url);
}
@@ -239,7 +240,7 @@ class Wiki extends Component {
});
});
let fileUrl = siteRoot + 'wiki/lib/' + repoID + filePath;
let fileUrl = siteRoot + 'wiki/lib/' + repoID + Utils.encodePath(filePath);
window.history.pushState({url: fileUrl, path: filePath}, filePath, fileUrl);
}
@@ -317,7 +318,7 @@ class Wiki extends Component {
let path = Utils.getPathFromInternalMarkdownLink(url, repoID);
this.showFile(path);
} else if (Utils.isInternalDirLink(url, repoID)) {
let path = Utils.getPathFromInternalDirLink(url, repoID, slug);
let path = Utils.getPathFromInternalDirLink(url, repoID);
this.showDir(path);
} else {
window.open(url);
@@ -900,7 +901,7 @@ class Wiki extends Component {
}
} else {
const w = window.open('about:blank');
const url = siteRoot + 'lib/' + repoID + '/file' + node.path;
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(node.path);
w.location.href = url;
}
}