]> khamidou — GitHub mirrors - electron.git/commitdiff
On Windows "Cancel" button is also forced to be canclId
authorCheng Zhao <zcbenz@gmail.com>
Wed, 8 Jul 2015 08:00:30 +0000 (16:00 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 8 Jul 2015 08:00:30 +0000 (16:00 +0800)
atom/browser/api/lib/dialog.coffee
docs/api/dialog.md

index 6ee334e29a53372d84ee9c585e523c03000e741b..61547affa2d4ede1f20903d3fdc3ab3b70335537 100644 (file)
@@ -101,12 +101,6 @@ module.exports =
           options.cancelId = i
           break
 
-    # On OS X the "Cancel" is always get selected when dialog is cancelled.
-    if process.platform is 'darwin'
-      for text, i in options.buttons when text is 'Cancel'
-        options.cancelId = i
-        break
-
     binding.showMessageBox messageBoxType,
                            options.buttons,
                            options.cancelId,
index 2023809b54baee2b4b189dd6cd4bde340d924181..9e123b381c51296d6c76f105aac662c402eef0ed 100644 (file)
@@ -79,8 +79,8 @@ will be passed via `callback(filename)`
   * `cancelId` Integer - The value will be returned when user cancels the dialog
     instead of clicking the buttons of the dialog. By default it is the index
     of the buttons that have "cancel" or "no" as label, or 0 if there is no such
-    buttons. On OS X the index of "Cancel" button will always be used as
-    `cancelId`, not matter whether it is already specified.
+    buttons. On OS X and Windows the index of "Cancel" button will always be
+    used as `cancelId`, not matter whether it is already specified.
 * `callback` Function
 
 Shows a message box, it will block until the message box is closed. It returns