Add pane-container:active-item-changed event

This commit is contained in:
Corey Johnson
2013-08-29 15:41:23 -07:00
parent 44de8fe2d3
commit 7fd0d934ef
4 changed files with 140 additions and 3 deletions

View File

@@ -113,7 +113,7 @@ class Pane extends View
# Public: Returns whether this pane is currently focused.
isActive: ->
@hasClass('active')
@getContainer()?.getActivePane() == this
# Public: Returns the next pane, ordered by creation.
getNextPane: ->
@@ -175,6 +175,7 @@ class Pane extends View
view.focus() if isFocused
@activeItem = item
@activeView = view
@getContainer()?.triggerActiveItemChange(item) if @isActive()
@trigger 'pane:active-item-changed', [item]
@state.set('activeItemUri', item.getUri?())
@@ -425,6 +426,7 @@ class Pane extends View
when 'after' then parent.insertChildAfter(this, newPane)
@getContainer().adjustPaneDimensions()
newPane.focus()
@getContainer().triggerActiveItemChange(newPane.getActivePaneItem())
newPane
# Private: