cordis/client/webapp/elements/events-window-buttons.ts

22 lines
625 B
TypeScript
Raw Normal View History

2021-10-30 17:26:41 +00:00
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');
});
}