mirror of
https://github.com/atom/atom.git
synced 2026-01-21 04:48:12 -05:00
Render proper atom-panels as children of containers
This commit is contained in:
@@ -50,6 +50,8 @@ describe "PanelContainerElement", ->
|
||||
container.addPanel(panel1)
|
||||
expect(element.childNodes.length).toBe 1
|
||||
|
||||
expect(element.childNodes[0].tagName).toBe 'ATOM-PANEL'
|
||||
|
||||
panel2 = new Panel({viewRegistry, item: new TestPanelItem(), orientation: 'left'})
|
||||
container.addPanel(panel2)
|
||||
expect(element.childNodes.length).toBe 2
|
||||
|
||||
@@ -7,7 +7,7 @@ class PanelElement extends HTMLElement
|
||||
getModel: -> @model
|
||||
|
||||
setModel: (@model) ->
|
||||
@appendChild(@model.getView())
|
||||
@appendChild(@model.getItemView())
|
||||
@subscriptions.add @model.onDidDestroy(@destroyed.bind(this))
|
||||
|
||||
destroyed: ->
|
||||
|
||||
@@ -9,7 +9,9 @@ class Panel
|
||||
destroy: ->
|
||||
@emitter.emit 'did-destroy', this
|
||||
|
||||
getView: -> @viewRegistry.getView(@item)
|
||||
getView: -> @viewRegistry.getView(this)
|
||||
|
||||
getItemView: -> @viewRegistry.getView(@item)
|
||||
|
||||
###
|
||||
Section: Event Subscription
|
||||
|
||||
Reference in New Issue
Block a user