Don't show the move dialog when the project is selected

This commit is contained in:
Kevin Sawicki
2013-01-11 14:07:05 -08:00
parent c442416c9f
commit 65df35c351
2 changed files with 7 additions and 1 deletions

View File

@@ -849,6 +849,12 @@ describe "TreeView", ->
expect(moveDialog.miniEditor.getText()).toBe(project.relativize(dotFilePath))
expect(moveDialog.miniEditor.getSelectedText()).toBe '.dotfile'
describe "when the project is selected", ->
it "doesn't display the move dialog", ->
treeView.root.click()
treeView.trigger "tree-view:move"
expect(rootView.find(".tree-view-dialog").view()).not.toExist()
describe "tree-view:remove", ->
it "shows the native alert dialog", ->
fileView.click()

View File

@@ -206,7 +206,7 @@ class TreeView extends ScrollView
moveSelectedEntry: ->
entry = @selectedEntry()
return unless entry
return unless entry and entry isnt @root
oldPath = entry.getPath()
if entry instanceof FileView
prompt = "Enter the new path for the file."