Add AtomWindow.openPath()

This commit is contained in:
Corey Johnson & Kevin Sawicki
2013-06-11 14:39:52 -07:00
parent dc53f387a6
commit b3e0ea6d33
2 changed files with 5 additions and 2 deletions

View File

@@ -230,8 +230,7 @@ class AtomApplication
existingWindow = @windowForPath(pathToOpen) unless pidToKillWhenClosed
if existingWindow
openedWindow = existingWindow
openedWindow.focus()
openedWindow.sendCommand('window:open-path', pathToOpen)
openedWindow.openPath(pathToOpen)
else
bootstrapScript = 'window-bootstrap'
openedWindow = new AtomWindow({pathToOpen, bootstrapScript, @resourcePath})

View File

@@ -62,6 +62,10 @@ class AtomWindow
event.preventDefault()
@sendCommand 'window:close'
openPath: (pathToOpen) ->
@focus()
@sendCommand('window:open-path', pathToOpen)
sendCommand: (command, args...) ->
ipc.sendChannel @browserWindow.getProcessId(), @browserWindow.getRoutingId(), 'command', command, args...