mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Add Pane::onDidActivate
This commit is contained in:
@@ -36,6 +36,8 @@ class PaneContainer extends Model
|
||||
root: @root?.serialize()
|
||||
activePaneId: @activePane.id
|
||||
|
||||
getRoot: -> @root
|
||||
|
||||
replaceChild: (oldChild, newChild) ->
|
||||
throw new Error("Replacing non-existent child") if oldChild isnt @root
|
||||
@root = newChild
|
||||
|
||||
@@ -94,6 +94,9 @@ class Pane extends Model
|
||||
# Called by the view layer to construct a view for this model.
|
||||
getViewClass: -> PaneView ?= require './pane-view'
|
||||
|
||||
onDidActivate: (fn) ->
|
||||
@emitter.on 'did-activate', fn
|
||||
|
||||
onDidAddItem: (fn) ->
|
||||
@emitter.on 'did-add-item', fn
|
||||
|
||||
@@ -123,6 +126,7 @@ class Pane extends Model
|
||||
activate: ->
|
||||
@container?.activePane = this
|
||||
@emit 'activated'
|
||||
@emitter.emit 'did-activate'
|
||||
|
||||
getPanes: -> [this]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user