Show the open dialog as child window on Windows and Linux.

On Mac the open dialog is still showed as independent dialog, this matches
most native apps' behavior.

Fixes #3401.
This commit is contained in:
Cheng Zhao
2014-09-12 21:43:01 +08:00
parent 8cffb8006a
commit 901ba72557

View File

@@ -484,6 +484,14 @@ class AtomApplication
when 'all' then ['openFile', 'openDirectory']
else throw new Error("#{type} is an invalid type for promptForPath")
# Show the open dialog as child window on Windows and Linux, and as
# independent dialog on OS X. This matches most native apps.
parentWindow =
if process.platform is 'darwin'
null
else
BrowserWindow.getFocusedWindow()
dialog = require 'dialog'
dialog.showOpenDialog title: 'Open', properties: properties.concat(['multiSelections', 'createDirectory']), (pathsToOpen) =>
dialog.showOpenDialog parentWindow, title: 'Open', properties: properties.concat(['multiSelections', 'createDirectory']), (pathsToOpen) =>
@openPaths({pathsToOpen, devMode, safeMode, window})