mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Don’t emit repeated attached events for the same PaneView
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user