mirror of
https://github.com/electron/electron.git
synced 2026-02-04 04:05:36 -05:00
Implement the confirm().
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user