-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
28 lines (26 loc) · 847 Bytes
/
script.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
/**
*
* @Name : CustomWindowsFormElectron/2-WithToolbar/script.js
* @Version : 1.0
* @Programmer : Max
- @Date : 2019-05-23
* @Released under : https://github.com/BaseMax/CustomWindowsFormElectron/blob/master/LICENSE
* @Repository : https://github.com/BaseMax/CustomWindowsFormElectron
*
**/
const remote = require('electron').remote;
let toolbarExit=document.getElementById("toolbar-exit");
let toolbarMin=document.getElementById("toolbar-min");
let toolbarMax=document.getElementById("toolbar-max");
toolbarExit.addEventListener("click", function() {
var window = remote.getCurrentWindow();
window.close();
});
toolbarMin.addEventListener("click", function() {
var window = remote.getCurrentWindow();
window.minimize();
});
toolbarMax.addEventListener("click", function() {
var window = remote.getCurrentWindow();
window.maximize();
});