From aab78db8b8393f689c43ff28c56f753e2b75dc9d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 8 Jul 2015 16:00:30 +0800 Subject: [PATCH] On Windows "Cancel" button is also forced to be canclId --- atom/browser/api/lib/dialog.coffee | 6 ------ docs/api/dialog.md | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/atom/browser/api/lib/dialog.coffee b/atom/browser/api/lib/dialog.coffee index 6ee334e29a53..61547affa2d4 100644 --- a/atom/browser/api/lib/dialog.coffee +++ b/atom/browser/api/lib/dialog.coffee @@ -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, diff --git a/docs/api/dialog.md b/docs/api/dialog.md index 2023809b54ba..9e123b381c51 100644 --- a/docs/api/dialog.md +++ b/docs/api/dialog.md @@ -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