cordis/client/webapp/elements/events-window-buttons.ts
2021-10-30 12:26:41 -05:00

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');
});
}