mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add Workspace::onWillDestroyPaneItem
It is needed by the autosave package which previously relied on DOM bubbling to coalesce events from various panes.
This commit is contained in:
@@ -112,6 +112,9 @@ class PaneContainer extends Model
|
||||
fn(@getActivePaneItem())
|
||||
@onDidChangeActivePaneItem(fn)
|
||||
|
||||
onWillDestroyPaneItem: (fn) ->
|
||||
@emitter.on 'will-destroy-pane-item', fn
|
||||
|
||||
onDidDestroyPaneItem: (fn) ->
|
||||
@emitter.on 'did-destroy-pane-item', fn
|
||||
|
||||
@@ -193,8 +196,11 @@ class PaneContainer extends Model
|
||||
destroyEmptyPanes: ->
|
||||
pane.destroy() for pane in @getPanes() when pane.items.length is 0
|
||||
|
||||
paneItemDestroyed: (item) ->
|
||||
@emitter.emit 'did-destroy-pane-item', item
|
||||
willDestroyPaneItem: (event) ->
|
||||
@emitter.emit 'will-destroy-pane-item', event
|
||||
|
||||
didDestroyPaneItem: (event) ->
|
||||
@emitter.emit 'did-destroy-pane-item', event
|
||||
|
||||
didAddPane: (pane) ->
|
||||
@emitter.emit 'did-add-pane', pane
|
||||
|
||||
Reference in New Issue
Block a user