This commit is contained in:
Heilig Benedek 2017-09-14 12:14:22 +02:00 committed by Cheng Zhao
parent 71b36ef54d
commit cafb9477b0

View file

@ -448,9 +448,9 @@ ipcMain.on('ELECTRON_BROWSER_WINDOW_ALERT', function (event, message, title) {
title: `${title}`, title: `${title}`,
buttons: ['OK'] buttons: ['OK']
} }
event.returnValue = event.sender.isOffscreen() ? event.returnValue = event.sender.isOffscreen()
electron.dialog.showMessageBox(dialogProperties) : ? electron.dialog.showMessageBox(dialogProperties)
electron.dialog.showMessageBox( : electron.dialog.showMessageBox(
event.sender.getOwnerBrowserWindow(), dialogProperties) event.sender.getOwnerBrowserWindow(), dialogProperties)
}) })
@ -459,15 +459,15 @@ ipcMain.on('ELECTRON_BROWSER_WINDOW_CONFIRM', function (event, message, title) {
if (message == null) message = '' if (message == null) message = ''
if (title == null) title = '' if (title == null) title = ''
const dialogProperties = { const dialogProperties = {
message: `${message}`, message: `${message}`,
title: `${title}`, title: `${title}`,
buttons: ['OK', 'Cancel'], buttons: ['OK', 'Cancel'],
cancelId: 1 cancelId: 1
} }
event.returnValue = !(event.sender.isOffscreen() ? event.returnValue = !(event.sender.isOffscreen()
electron.dialog.showMessageBox(dialogProperties) : ? electron.dialog.showMessageBox(dialogProperties)
electron.dialog.showMessageBox( : electron.dialog.showMessageBox(
event.sender.getOwnerBrowserWindow(), dialogProperties)) event.sender.getOwnerBrowserWindow(), dialogProperties))
}) })