Use the dialog API to implement alert().
This commit is contained in:
parent
753a1e7aff
commit
ff9027fa95
1 changed files with 7 additions and 0 deletions
|
@ -34,3 +34,10 @@ window.open = (url, name, features) ->
|
|||
browser = new BrowserWindow options
|
||||
browser.loadUrl url
|
||||
browser
|
||||
|
||||
# Use the dialog API to implement alert().
|
||||
window.alert = (message, title='') ->
|
||||
remote = require 'remote'
|
||||
dialog = remote.require 'dialog'
|
||||
buttons = ['OK']
|
||||
dialog.showMessageBox remote.getCurrentWindow(), {message, title, buttons}
|
||||
|
|
Loading…
Reference in a new issue