]> khamidou — GitHub mirrors - electron.git/commitdiff
Implement the confirm().
authorCheng Zhao <zcbenz@gmail.com>
Sat, 1 Mar 2014 12:03:49 +0000 (20:03 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sat, 1 Mar 2014 12:03:49 +0000 (20:03 +0800)
renderer/lib/override.coffee

index 7e0b42ec65673f881eecd7804914ca2b2b4ef7c1..b369908256c8895096da096ea7aaf0a8c011a74c 100644 (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}