UNPKG

metadata-editor-workspace

Version:

Metadata Editor Workspace module for ME-Core Powered by Assyst

50 lines (39 loc) 1.35 kB
/** * Include our app */ const {app, BrowserWindow } = require('electron'); const electron = require('electron'); // browser-window creates a native window let mainWindow = null; app.on('window-all-closed', () => { // On macOS it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform !== 'darwin') { app.quit(); } }); const createWindow = () => { //Set the webpack distribution path let fPath = __dirname; if(fPath.indexOf('src') != -1) { fPath = fPath.split('\src')[0] + 'dist'; } // Initialize the window to our specified dimensions mainWindow = new BrowserWindow({ width: 1200, height: 900, icon: fPath+'/assets/icon/favicon.ico' }); // Tell Electron where to load the entry point from mainWindow.loadURL('file://' + fPath + '/dist/index.html') // Open the DevTools. //mainWindow.webContents.openDevTools(); // Clear out the main window when the app is closed mainWindow.on('closed', () => { mainWindow = null; }); }; app.on('ready', createWindow); app.on('activate', () => { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. if (mainWindow === null) { createWindow(); } });