From b1563fdfc0af832e4e0ec71ad2d6388d9406bf74 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 9 Jun 2014 15:04:51 +0900 Subject: [PATCH] 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. --- src/pane.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pane.coffee b/src/pane.coffee index e0c579257..19066e126 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -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: ->