Explicitly make pane active

Previously it relied on focus firing an event which will not occur
when not on the DOM.
This commit is contained in:
Kevin Sawicki
2013-10-16 12:04:14 -07:00
parent 2d9c2ec939
commit 08e5c42f0c
3 changed files with 3 additions and 4 deletions

View File

@@ -87,9 +87,6 @@ describe "PaneContainer", ->
expect(panes).toEqual []
describe ".reopenItem()", ->
beforeEach ->
pane3.makeActive()
describe "when there is an active pane", ->
it "reconstructs and shows the last-closed pane item", ->
expect(container.getActivePane()).toBe pane3

View File

@@ -113,7 +113,8 @@ class PaneContainer extends View
@empty()
if root?
@append(root)
@itemAdded(root.activeItem) if root.activeItem
@itemAdded(root.activeItem) if root.activeItem?
root.makeActive?()
@state.set(root: root?.getState())
removeChild: (child) ->

View File

@@ -412,6 +412,7 @@ class Pane extends View
when 'before' then parent.insertChildBefore(this, newPane)
when 'after' then parent.insertChildAfter(this, newPane)
@getContainer().adjustPaneDimensions()
newPane.makeActive()
newPane.focus()
newPane