diff --git a/spec/view-registry-spec.coffee b/spec/view-registry-spec.coffee index 254649311..851faf109 100644 --- a/spec/view-registry-spec.coffee +++ b/spec/view-registry-spec.coffee @@ -14,14 +14,14 @@ describe "ViewRegistry", -> expect(registry.getView(node)).toBe node describe "when passed a SpacePen view", -> - it "returns the root node of the view with a __spacePenView property pointing at the SpacePen view", -> + it "returns the root node of the view with a .spacePenView property pointing at the SpacePen view", -> class TestView extends View @content: -> @div "Hello" view = new TestView node = registry.getView(view) expect(node.textContent).toBe "Hello" - expect(node.__spacePenView).toBe view + expect(node.spacePenView).toBe view describe "when passed a model object", -> describe "when a view provider is registered matching the object's constructor", -> @@ -62,7 +62,7 @@ describe "ViewRegistry", -> node = registry.getView(model) expect(node.textContent).toBe "hello" - view = node.__spacePenView + view = node.spacePenView expect(view instanceof TestView).toBe true expect(view.model).toBe model diff --git a/src/pane-view.coffee b/src/pane-view.coffee index 16492d7e1..03ca52558 100644 --- a/src/pane-view.coffee +++ b/src/pane-view.coffee @@ -153,7 +153,9 @@ class PaneView extends View activeItemModifiedChanged: => @trigger 'pane:active-item-modified-status-changed' - @::accessor 'activeView', -> atom.views.getView(@activeItem)?.__spacePenView + @::accessor 'activeView', -> + element = atom.views.getView(@activeItem) + $(element).view() ? element splitLeft: (items...) -> atom.views.getView(@model.splitLeft({items})).__spacePenView diff --git a/src/view-registry.coffee b/src/view-registry.coffee index 664d03d18..c66d1be57 100644 --- a/src/view-registry.coffee +++ b/src/view-registry.coffee @@ -132,7 +132,6 @@ class ViewRegistry if object instanceof HTMLElement object else if object?.jquery - object[0]?.__spacePenView ?= object object[0] else if provider = @findProvider(object) element = provider.createView?(object) @@ -142,7 +141,6 @@ class ViewRegistry element else if viewConstructor = object?.getViewClass?() view = new viewConstructor(object) - view[0].__spacePenView ?= view view[0] else throw new Error("Can't create a view for #{object.constructor.name} instance. Please register a view provider.")