1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 23:48:47 +00:00

fix: update window.open function for integrate to onlyoffice (#4742)

This commit is contained in:
杨顺强
2020-12-10 11:30:16 +08:00
committed by GitHub
parent c0d60d4497
commit 2a6faa5208

View File

@@ -1176,8 +1176,7 @@ class LibContentView extends React.Component {
let isWeChat = Utils.isWeChat();
if (!isWeChat) {
let newWindow = window.open('about:blank');
newWindow.location.href = url;
window.open(url);
} else {
location.href = url;
}
@@ -1535,9 +1534,8 @@ class LibContentView extends React.Component {
this.showColumnMarkdownFile(node.path);
}
} else {
const w = window.open('about:blank');
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(node.path);
w.location.href = url;
window.open(url);
}
}
}
@@ -1546,6 +1544,7 @@ class LibContentView extends React.Component {
let repoID = this.props.repoID;
seafileAPI.getFileInfo(repoID, filePath).then((res) => {
if (res.data.size === 0) {
// loading of asynchronously obtained data may be blocked
const w = window.open('about:blank');
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(filePath);
w.location.href = url;