Add back ability to open an arbitrary window

atom.open now takes an options has that can contain either pathsToOpen
or the complete settings of a new window.

This will be used by the collaboration package to open the window when a
session is being joined.
This commit is contained in:
Kevin Sawicki
2013-08-20 15:24:30 -07:00
parent 90da89d31c
commit 6e2fd18f62
4 changed files with 13 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ fsUtils = require 'fs-utils'
path = require 'path'
telepath = require 'telepath'
$ = require 'jquery'
_ = require 'underscore'
less = require 'less'
remote = require 'remote'
ipc = require 'ipc'
@@ -86,8 +87,8 @@ window.installApmCommand = (callback) ->
window.onDrop = (e) ->
e.preventDefault()
e.stopPropagation()
for file in e.originalEvent.dataTransfer.files
atom.open(file.path)
pathsToOpen = _.pluck(e.originalEvent.dataTransfer.files, 'path')
atom.open({pathsToOpen}) if pathsToOpen.length > 0
window.deserializeEditorWindow = ->
RootView = require 'root-view'