Make dialog.showSaveDialog accept no parent window.

This commit is contained in:
Cheng Zhao 2013-09-23 19:59:00 +08:00
parent e824b6c910
commit 30ca085fd8
2 changed files with 23 additions and 14 deletions

View file

@ -31,16 +31,21 @@ module.exports =
window,
callback
showSaveDialog: (window, options) ->
throw new TypeError('Invalid window') unless window?.constructor is BrowserWindow
showSaveDialog: (window, options, callback) ->
unless window?.constructor is BrowserWindow
# Shift.
callback = options
options = window
window = null
options ?= title: 'Save'
options.title ?= ''
options.defaultPath ?= ''
binding.showSaveDialog window,
String(options.title),
String(options.defaultPath)
binding.showSaveDialog String(options.title),
String(options.defaultPath),
window,
callback
showMessageBox: (window, options, callback) ->
unless window?.constructor is BrowserWindow