From 2a6faa5208cfe38e5074a6a40a9fd04a8e07ee50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E9=A1=BA=E5=BC=BA?= Date: Thu, 10 Dec 2020 11:30:16 +0800 Subject: [PATCH] fix: update window.open function for integrate to onlyoffice (#4742) --- frontend/src/pages/lib-content-view/lib-content-view.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/lib-content-view/lib-content-view.js b/frontend/src/pages/lib-content-view/lib-content-view.js index 9aef8750f2..cf0149b2ef 100644 --- a/frontend/src/pages/lib-content-view/lib-content-view.js +++ b/frontend/src/pages/lib-content-view/lib-content-view.js @@ -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;