"move to new window" respects note hoisting of original tab

This commit is contained in:
zadam
2021-02-07 21:27:09 +01:00
parent cd5be59413
commit bed7bdfd00
9 changed files with 38 additions and 14 deletions

View File

@@ -15,7 +15,7 @@ let mainWindow;
/** @type {Electron.BrowserWindow} */
let setupWindow;
async function createExtraWindow(notePath) {
async function createExtraWindow(notePath, hoistedNoteId = 'root') {
const {BrowserWindow} = require('electron');
const win = new BrowserWindow({
width: 1000,
@@ -31,11 +31,11 @@ async function createExtraWindow(notePath) {
});
win.setMenuBarVisibility(false);
win.loadURL('http://127.0.0.1:' + await port + '/?extra=1#' + notePath);
win.loadURL('http://127.0.0.1:' + await port + '/?extra=1&extraHoistedNoteId=' + hoistedNoteId + '#' + notePath);
}
ipcMain.on('create-extra-window', (event, arg) => {
createExtraWindow(arg.notePath);
createExtraWindow(arg.notePath, arg.hoistedNoteId);
});
async function createMainWindow() {