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

optimized onsearched handle

This commit is contained in:
shanshuirenjia
2019-04-26 11:34:11 +08:00
parent 3f67bd62e4
commit b176873974
3 changed files with 17 additions and 21 deletions

View File

@@ -186,16 +186,8 @@ class FileHistory extends React.Component {
}
}
onSearchedClick = (selectedItem) => {
if (selectedItem.is_dir === true) {
let url = siteRoot + 'library/' + selectedItem.repo_id + '/' + selectedItem.repo_name + selectedItem.path;
let newWindow = window.open('about:blank');
newWindow.location.href = url;
} else {
let url = siteRoot + 'lib/' + selectedItem.repo_id + '/file' + Utils.encodePath(selectedItem.path);
let newWindow = window.open('about:blank');
newWindow.location.href = url;
}
onSearchedClick = (searchedItem) => {
Utils.handleSearchedItemClick(searchedItem);
}
render() {