Make RootView.open work with new Pane behavior

Still a bit of a WIP. Panes don't yet take the "active" class
correctly when focused.
This commit is contained in:
Nathan Sobo
2013-02-18 17:28:29 -07:00
committed by probablycorey
parent 829bfa0a10
commit bee1efed5c
2 changed files with 36 additions and 80 deletions

View File

@@ -92,15 +92,18 @@ class RootView extends View
open: (path, options = {}) ->
if activePane = @getActivePane()
if existingItem = activePane.itemForPath(path)
activePane.showItem(existingItem)
if editSession = activePane.itemForPath(path)
activePane.showItem(editSession)
else
activePane.showItem(project.buildEditSession(path))
editSession = project.buildEditSession(path)
activePane.showItem(editSession)
else
activePane = new Pane(project.buildEditSession(path))
editSession = project.buildEditSession(path)
activePane = new Pane(editSession)
@panes.append(activePane)
activePane.focus() if options.changeFocus
editSession
editorFocused: (editor) ->
@makeEditorActive(editor) if @panes.containsElement(editor)