-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
36 lines (31 loc) · 782 Bytes
/
index.js
File metadata and controls
36 lines (31 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var electron = require('electron');
var config = require('./config')(electron.app);
// Our main app window
var appWindow;
electron.app.on('ready', createAppWindow);
electron.app.on('window-all-closed', allWindowsClosed);
electron.app.on('activate', onActivate);
function createAppWindow () {
appWindow = new electron.BrowserWindow({
width: config.width,
height: config.height,
x: config.x,
y: config.y,
titleBarStyle: 'hidden'
});
appWindow.loadURL('file://' + config.cwd + '/index.html');
appWindow.on('closed', function () {
appWindow = null;
});
// appWindow.webContents.openDevTools();
}
function allWindowsClosed () {
if (process.platform !== 'darwin') {
electron.app.quit();
}
}
function onActivate () {
if (!appWindow) {
createAppWindow();
}
}