added global menu item to open new empty window + some refactoring

This commit is contained in:
zadam
2020-05-05 19:30:03 +02:00
parent c7125d2b50
commit 6dfe335707
8 changed files with 41 additions and 27 deletions

View File

@@ -182,4 +182,21 @@ export default class Entrypoints extends Component {
}
createTopLevelNoteCommand() { noteCreateService.createNewTopLevelNote(); }
async openInWindowCommand({notePath}) {
if (utils.isElectron()) {
const {ipcRenderer} = utils.dynamicRequire('electron');
ipcRenderer.send('create-extra-window', {notePath});
}
else {
const url = window.location.protocol + '//' + window.location.host + window.location.pathname + '?extra=1#' + notePath;
window.open(url, '', 'width=1000,height=800');
}
}
async openNewWindowCommand() {
this.openInWindowCommand({notePath: ''});
}
}