Make atom.open work with parameters.

This commit is contained in:
Cheng Zhao
2013-05-25 14:38:04 +08:00
parent 0cdbfed7ab
commit 462bd77ad5
2 changed files with 8 additions and 9 deletions

View File

@@ -155,10 +155,12 @@ class AtomApplication
ipc.on 'open-config', =>
@openConfig()
ipc.on 'open-folder', =>
currentWindow = BrowserWindow.getFocusedWindow()
pathsToOpen = dialog.showOpenDialog title: 'Open', properties: ['openFile', 'openDirectory', 'multiSelections', 'createDirectory']
@open(pathToOpen) for pathToOpen in pathsToOpen if pathsToOpen?
ipc.on 'open', (processId, routingId, pathsToOpen) =>
if not pathsToOpen
pathsToOpen = dialog.showOpenDialog title: 'Open', properties: ['openFile', 'openDirectory', 'multiSelections', 'createDirectory']
@open(pathsToOpen) if pathsToOpen?
else
@open(pathsToOpen)
ipc.on 'new-window', =>
@open()