Pane emits 'pane:item-added' events

This commit is contained in:
Nathan Sobo
2013-02-25 17:11:29 -07:00
committed by probablycorey
parent a40d05f6ee
commit dd120663b7
3 changed files with 114 additions and 2 deletions

View File

@@ -84,7 +84,9 @@ class Pane extends View
addItem: (item) ->
return if _.include(@items, item)
@items.splice(@getActiveItemIndex() + 1, 0, item)
index = @getActiveItemIndex() + 1
@items.splice(index, 0, item)
@trigger 'pane:item-added', [item, index]
item
removeActiveItem: =>