Render proper atom-panels as children of containers

This commit is contained in:
Ben Ogle
2014-10-16 16:48:56 -07:00
parent 299710f08a
commit 52c05eade7
3 changed files with 6 additions and 2 deletions

View File

@@ -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

View File

@@ -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: ->

View File

@@ -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