mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Only dispose PaneElement subscriptions when pane is destroyed
Not when the element is detached, because it might be reattached.
This commit is contained in:
@@ -12,9 +12,6 @@ class PaneElement extends HTMLElement
|
||||
attachedCallback: ->
|
||||
@focus() if @model.isFocused()
|
||||
|
||||
detachedCallback: ->
|
||||
@subscriptions.dispose()
|
||||
|
||||
initializeContent: ->
|
||||
@setAttribute 'class', 'pane'
|
||||
@setAttribute 'tabindex', -1
|
||||
@@ -36,6 +33,7 @@ class PaneElement extends HTMLElement
|
||||
@subscriptions.add @model.observeActive(@activeStatusChanged.bind(this))
|
||||
@subscriptions.add @model.observeActiveItem(@activeItemChanged.bind(this))
|
||||
@subscriptions.add @model.onDidRemoveItem(@itemRemoved.bind(this))
|
||||
@subscriptions.add @model.onDidDestroy(@paneDestroyed.bind(this))
|
||||
@__spacePenView.setModel(@model)
|
||||
|
||||
activated: ->
|
||||
@@ -69,6 +67,9 @@ class PaneElement extends HTMLElement
|
||||
else
|
||||
viewToRemove.detach()
|
||||
|
||||
paneDestroyed: ->
|
||||
@subscriptions.dispose()
|
||||
|
||||
getActiveView: -> @model.getView(@model.getActiveItem())
|
||||
|
||||
hasFocus: ->
|
||||
|
||||
Reference in New Issue
Block a user