Fix no close button in message box on Windows

This resolves #2293.
This commit is contained in:
Eran Tiktin 2015-08-22 04:20:52 +03:00
parent d7cf460918
commit b1406fbad9
2 changed files with 7 additions and 4 deletions

View file

@ -80,12 +80,15 @@ window.alert = (message, title='') ->
buttons = ['OK']
message = message.toString()
dialog.showMessageBox remote.getCurrentWindow(), {message, title, buttons}
# Alert should always return undefined.
return
# And the confirm().
window.confirm = (message, title='') ->
dialog = remote.require 'dialog'
buttons = ['OK', 'Cancel']
not dialog.showMessageBox remote.getCurrentWindow(), {message, title, buttons}
cancelId = 1
not dialog.showMessageBox remote.getCurrentWindow(), {message, title, buttons, cancelId}
# But we do not support prompt().
window.prompt = ->