mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Don't attach the TreeView when the project has no path
This commit is contained in:
@@ -54,7 +54,12 @@ describe "TreeView", ->
|
||||
atom.loadPackage 'tree-view'
|
||||
treeView = TreeView.instance
|
||||
|
||||
it "does not attach or create a root node", ->
|
||||
it "does not attach to the root view or create a root node when initialized", ->
|
||||
expect(treeView.hasParent()).toBeFalsy()
|
||||
expect(treeView.root).not.toExist()
|
||||
|
||||
it "does not attach to the root view or create a root node when attach() is called", ->
|
||||
treeView.attach()
|
||||
expect(treeView.hasParent()).toBeFalsy()
|
||||
expect(treeView.root).not.toExist()
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ class TreeView extends ScrollView
|
||||
@attach()
|
||||
|
||||
attach: ->
|
||||
return unless rootView.project.getPath()
|
||||
@rootView.horizontal.prepend(this)
|
||||
@focus()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user