🚱 Call off on active item when it is removed

This commit is contained in:
Kevin Sawicki & Nathan Sobo 2013-08-27 12:59:05 -07:00
parent 6baaf404af
commit e28ef3a76c

View File

@ -281,6 +281,7 @@ class Pane extends View
# Public: Just remove the item at the given index.
removeItemAtIndex: (index, options={}) ->
item = @items[index]
@activeItem.off? 'title-changed', @activeItemTitleChanged if item is @activeItem
@showNextItem() if item is @activeItem and @items.length > 1
_.remove(@items, item)
@state.get('items').remove(index) if options.updateState ? true