This commit is contained in:
Vanessa 2023-03-29 09:12:04 +08:00 committed by Liang Ding
parent db95671a65
commit 2678009a22
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 27 additions and 4 deletions

View file

@ -124,6 +124,9 @@ const openFile = (options: IOpenFileOptions) => {
if ((jsonObj.children.rootId && jsonObj.children.rootId === options.rootID) ||
(jsonObj.children.path && jsonObj.children.path === options.assetPath)) {
item.focus();
if (options.assetPath) {
item.webContents.executeJavaScript(`window.newWindow.positionPDF("${options.assetPath}", ${typeof options.page === "number" ? options.page : `"${options.page}"`})`);
}
hasOpen = true;
return true;
}