mirror of
https://github.com/atom/atom.git
synced 2026-02-19 02:44:29 -05:00
Transfer focus to the root view when the last focused pane is destroyed
This commit is contained in:
@@ -21,6 +21,7 @@ class PaneContainer extends View
|
||||
@model = new PaneContainerModel({root: params?.root?.model})
|
||||
|
||||
@subscribe @model.$root, 'value', @onRootChanged
|
||||
@subscribe @model, 'surrendered-focus', @onSurrenderedFocus
|
||||
|
||||
@subscribe this, 'pane:attached', (event, pane) =>
|
||||
@triggerActiveItemChange() if @getActivePane() is pane
|
||||
@@ -89,6 +90,9 @@ class PaneContainer extends View
|
||||
@append(view)
|
||||
view.makeActive?()
|
||||
|
||||
onSurrenderedFocus: =>
|
||||
atom?.workspaceView?.focus()
|
||||
|
||||
removeChild: (child) ->
|
||||
throw new Error("Removing non-existant child") unless @getRoot() is child
|
||||
@setRoot(null)
|
||||
|
||||
Reference in New Issue
Block a user