mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-06 01:12:03 +00:00
optimized onsearched handle
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { mediaUrl, gettext, serviceURL } from './constants';
|
||||
import { mediaUrl, gettext, serviceURL, siteRoot } from './constants';
|
||||
import { strChineseFirstPY } from './pinyin-by-unicode';
|
||||
|
||||
export const Utils = {
|
||||
@@ -801,4 +801,16 @@ export const Utils = {
|
||||
return message;
|
||||
},
|
||||
|
||||
handleSearchedItemClick: function(searchedItem) {
|
||||
if (searchedItem.is_dir === true) {
|
||||
let url = siteRoot + 'library/' + searchedItem.repo_id + '/' + searchedItem.repo_name + searchedItem.path;
|
||||
let newWindow = window.open('about:blank');
|
||||
newWindow.location.href = url;
|
||||
} else {
|
||||
let url = siteRoot + 'lib/' + searchedItem.repo_id + '/file' + Utils.encodePath(searchedItem.path);
|
||||
let newWindow = window.open('about:blank');
|
||||
newWindow.location.href = url;
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user