prototype for new app window

This commit is contained in:
zadam
2020-04-23 23:08:15 +02:00
parent ff853c7d0a
commit 32020d78b5
11 changed files with 556 additions and 231 deletions

View File

@@ -17,14 +17,14 @@ class AppContext extends Component {
this.layout = layout;
}
async start() {
async start(loadExistingTabs = true) {
await Promise.all([treeCache.initializedPromise, options.initializedPromise]);
$("#loading-indicator").hide();
this.showWidgets();
this.tabManager.loadTabs();
this.tabManager.loadTabs(loadExistingTabs);
if (utils.isDesktop()) {
setTimeout(() => bundleService.executeStartupBundles(), 2000);
@@ -100,6 +100,19 @@ class AppContext extends Component {
this.triggerEvent('treeCacheReloaded');
}
async openInNewWindow(notePath) {
if (utils.isElectron()) {
const {ipcRenderer} = utils.dynamicRequire('electron');
ipcRenderer.send('create-extra-window', {notePath});
}
else {
const url = 'http://127.0.0.1:37740/#' + notePath;
window.open(url);
}
}
}
const appContext = new AppContext();