Don’t emit repeated attached events for the same PaneView

This commit is contained in:
Nathan Sobo
2014-09-18 13:41:48 -06:00
parent 60a551b308
commit 32f0eb4f76

View File

@@ -26,6 +26,7 @@ class PaneView extends View
'activate', 'getActiveItem', toProperty: 'model'
previousActiveItem: null
attached: false
constructor: (@element) ->
@itemViews = $(element.itemViews)
@@ -43,7 +44,8 @@ class PaneView extends View
afterAttach: ->
@container ?= @closest('.panes').view()
@trigger('pane:attached', [this])
@trigger('pane:attached', [this]) unless @attached
@attached = true
onPaneDestroyed: =>
@container?.trigger 'pane:removed', [this]