1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-04 00:20:07 +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(); let isWeChat = Utils.isWeChat();
if (!isWeChat) { if (!isWeChat) {
let newWindow = window.open('about:blank'); window.open(url);
newWindow.location.href = url;
} else { } else {
location.href = url; location.href = url;
} }
@@ -1535,9 +1534,8 @@ class LibContentView extends React.Component {
this.showColumnMarkdownFile(node.path); this.showColumnMarkdownFile(node.path);
} }
} else { } else {
const w = window.open('about:blank');
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(node.path); 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; let repoID = this.props.repoID;
seafileAPI.getFileInfo(repoID, filePath).then((res) => { seafileAPI.getFileInfo(repoID, filePath).then((res) => {
if (res.data.size === 0) { if (res.data.size === 0) {
// loading of asynchronously obtained data may be blocked
const w = window.open('about:blank'); const w = window.open('about:blank');
const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(filePath); const url = siteRoot + 'lib/' + repoID + '/file' + Utils.encodePath(filePath);
w.location.href = url; w.location.href = url;