mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Focus pane after reopening it
Previously the reopened item would not have focus if it was reopened into a newly appended pane.
This commit is contained in:
@@ -110,7 +110,8 @@ describe "PaneContainer", ->
|
||||
expect(pane1.activeItem).toEqual item3
|
||||
|
||||
describe "when there is no active pane", ->
|
||||
it "attaches a new pane with the reconstructed last pane item", ->
|
||||
it "attaches a new pane with the reconstructed last pane item and focuses it", ->
|
||||
container.attachToDom()
|
||||
pane1.remove()
|
||||
pane2.remove()
|
||||
item3 = pane3.activeItem
|
||||
@@ -120,6 +121,7 @@ describe "PaneContainer", ->
|
||||
container.reopenItem()
|
||||
|
||||
expect(container.getActivePane().activeItem).toEqual item3
|
||||
expect(container.getActivePane().activeView).toMatchSelector ':focus'
|
||||
|
||||
it "does not reopen an item that is already open", ->
|
||||
item3 = pane3.activeItem
|
||||
|
||||
@@ -55,7 +55,9 @@ class PaneContainer extends View
|
||||
activePane.showItem(deserialize(lastItemState))
|
||||
true
|
||||
else
|
||||
@append(new Pane(deserialize(lastItemState)))
|
||||
newPane = new Pane(deserialize(lastItemState))
|
||||
@append(newPane)
|
||||
newPane.focus()
|
||||
|
||||
itemDestroyed: (item) ->
|
||||
state = item.serialize?()
|
||||
|
||||
Reference in New Issue
Block a user