mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Destroy item's of last pane even if the pane itself is not destroyed
We always want to preserve at least one pane, so we don't call destroy on the pane if it is the last pane. However, we still want to destroy its items. This was previously relying on the view to destroy the underlying item, which isn't as reliable as doing it in the model.
This commit is contained in:
@@ -212,7 +212,10 @@ class Pane extends Model
|
||||
@destroyItem(item) for item in @getItems() when item isnt @activeItem
|
||||
|
||||
destroy: ->
|
||||
super unless @container?.isAlive() and @container?.getPanes().length is 1
|
||||
if @container?.isAlive() and @container.getPanes().length is 1
|
||||
@destroyItems()
|
||||
else
|
||||
super
|
||||
|
||||
# Called by model superclass.
|
||||
destroyed: ->
|
||||
|
||||
Reference in New Issue
Block a user