Implement the confirm().

This commit is contained in:
Cheng Zhao 2014-03-01 20:03:49 +08:00
parent ff9027fa95
commit 3f1d540077

View file

@ -41,3 +41,10 @@ window.alert = (message, title='') ->
dialog = remote.require 'dialog'
buttons = ['OK']
dialog.showMessageBox remote.getCurrentWindow(), {message, title, buttons}
# And the confirm().
window.confirm = (message, title='') ->
remote = require 'remote'
dialog = remote.require 'dialog'
buttons = ['OK', 'Cancel']
not dialog.showMessageBox remote.getCurrentWindow(), {message, title, buttons}