mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Only call show on active item when attached
Closes atom/settings-view#258
This commit is contained in:
@@ -4,14 +4,19 @@ PaneView = require './pane-view'
|
||||
|
||||
class PaneElement extends HTMLElement
|
||||
createdCallback: ->
|
||||
@attached = false
|
||||
@subscriptions = new CompositeDisposable
|
||||
@initializeContent()
|
||||
@subscribeToDOMEvents()
|
||||
@createSpacePenShim()
|
||||
|
||||
attachedCallback: ->
|
||||
@attached = true
|
||||
@focus() if @model.isFocused()
|
||||
|
||||
detachedCallback: ->
|
||||
@attached = false
|
||||
|
||||
initializeContent: ->
|
||||
@setAttribute 'class', 'pane'
|
||||
@setAttribute 'tabindex', -1
|
||||
@@ -52,7 +57,7 @@ class PaneElement extends HTMLElement
|
||||
view = @model.getView(item).__spacePenView
|
||||
otherView.hide() for otherView in $itemViews.children().not(view).views()
|
||||
$itemViews.append(view) unless view.parent().is($itemViews)
|
||||
view.show()
|
||||
view.show() if @attached
|
||||
view.focus() if @hasFocus()
|
||||
|
||||
itemRemoved: ({item, index, destroyed}) ->
|
||||
|
||||
Reference in New Issue
Block a user