fix(T2408): On the Mac, show open / save dialogs as sheets

Fixes T2408
This commit is contained in:
Ben Gotow 2015-07-30 16:34:25 -07:00
parent 43711f93fe
commit 1ff1c4055a

View file

@ -808,14 +808,12 @@ class Atom extends Model
remote.process.exit(status)
showOpenDialog: (options, callback) ->
parentWindow = if process.platform is 'darwin' then null else @getCurrentWindow()
dialog = remote.require('dialog')
dialog.showOpenDialog(parentWindow, options, callback)
dialog.showOpenDialog(@getCurrentWindow(), options, callback)
showSaveDialog: (defaultPath, callback) ->
parentWindow = if process.platform is 'darwin' then null else @getCurrentWindow()
dialog = remote.require('dialog')
dialog.showSaveDialog(parentWindow, {title: 'Save File', defaultPath}, callback)
dialog.showSaveDialog(@getCurrentWindow(), {title: 'Save File', defaultPath}, callback)
saveSync: ->
stateString = JSON.stringify(@savedState)