22 lines
625 B
TypeScript
22 lines
625 B
TypeScript
|
import * as electron from 'electron';
|
||
|
import IState from './require/elements-state';
|
||
|
|
||
|
import { $, $$, $$$, $$$$ } from './require/q-module';
|
||
|
|
||
|
export default function bindWindowButtonEvents(state: IState): void {
|
||
|
const { document } = state;
|
||
|
$.setDocument(document);
|
||
|
|
||
|
$('#minimize').addEventListener('click', () => {
|
||
|
electron.ipcRenderer.send('minimize');
|
||
|
});
|
||
|
|
||
|
$('#maximize').addEventListener('click', () => {
|
||
|
electron.ipcRenderer.send('maximize');
|
||
|
});
|
||
|
|
||
|
$('#close').addEventListener('click', () => {
|
||
|
electron.ipcRenderer.send('close');
|
||
|
});
|
||
|
}
|