electron/docs/fiddles/native-ui/dialogs/information-dialog/renderer.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
453 B
JavaScript
Raw Normal View History

const { ipcRenderer } = require('electron/renderer')
2020-08-27 14:31:51 +00:00
const informationBtn = document.getElementById('information-dialog')
informationBtn.addEventListener('click', event => {
ipcRenderer.send('open-information-dialog')
})
ipcRenderer.on('information-dialog-selection', (event, index) => {
let message = 'You selected '
if (index === 0) message += 'yes.'
else message += 'no.'
document.getElementById('info-selection').innerHTML = message
})