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

@@ -100,19 +100,6 @@ class AppContext extends Component {
getComponentByEl(el) {
return $(el).closest(".component").prop('component');
}
async openInNewWindow(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');
}
}
}
const appContext = new AppContext(window.glob.isMainWindow);