-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.js
34 lines (27 loc) · 945 Bytes
/
index.js
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
const { remote } = require('electron');
const { ipcRenderer } = require('electron');
const { ServiceList } = require('./service_list');
const window = remote.getCurrentWindow();
function resizeWindow () {
let height = 12;
height += document.getElementById('events').clientHeight;
height += document.getElementById('service-list').clientHeight;
const width = document.getElementById('events').clientWidth;
window.setSize(width, height);
}
ipcRenderer.on('vibrancy', (_, vibrancy) => {
document.body.className = vibrancy;
});
document.addEventListener('DOMContentLoaded', () => {
const serviceListElement = document.getElementById('service-list');
const serviceList = new ServiceList(serviceListElement);
serviceList.load();
resizeWindow();
document.getElementById('quit').addEventListener('click', () => {
remote.app.quit();
});
window.on('show', () => {
serviceList.load();
resizeWindow();
});
});