mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Remove view registry references from the workspace model layer
Removed various ::getView methods from the model. Using the atom.views global in the views for now, but going to switch them over to using a locally assigned view registry instead in a subsequent commit.
This commit is contained in:
committed by
Max Brunsfeld
parent
b635fa0c97
commit
4591f00a65
@@ -8,15 +8,17 @@ class PanelElement extends HTMLElement
|
||||
getModel: -> @model
|
||||
|
||||
setModel: (@model) ->
|
||||
view = @model.getItemView()
|
||||
@appendChild(view)
|
||||
@appendChild(@getItemView())
|
||||
|
||||
@classList.add(@model.getClassName().split(' ')...) if @model.getClassName()?
|
||||
@subscriptions.add @model.onDidChangeVisible(@visibleChanged.bind(this))
|
||||
@subscriptions.add @model.onDidDestroy(@destroyed.bind(this))
|
||||
|
||||
getItemView: ->
|
||||
atom.views.getView(@model.getItem())
|
||||
|
||||
attachedCallback: ->
|
||||
callAttachHooks(@model.getItemView()) # for backward compatibility with SpacePen views
|
||||
callAttachHooks(@getItemView()) # for backward compatibility with SpacePen views
|
||||
@visibleChanged(@model.isVisible())
|
||||
|
||||
visibleChanged: (visible) ->
|
||||
|
||||
Reference in New Issue
Block a user