Skip to content

Commit

Permalink
explorer: better root dnd
Browse files Browse the repository at this point in the history
fixes #35032
  • Loading branch information
isidorn committed Jan 5, 2018
1 parent 17a5c2f commit bc1a048
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -661,10 +661,6 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop {
}

private statToResource(stat: FileStat): URI {
if (stat.isRoot) {
return null; // Can not move root folder
}

if (stat.isDirectory) {
return URI.from({ scheme: 'folder', path: stat.resource.path }); // indicates that we are dragging a folder
}
Expand Down Expand Up @@ -746,6 +742,10 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop {
return true; // NewStatPlaceholders can not be moved
}

if (source.isRoot) {
return true; // Root folder can not be moved
}

if (source.resource.toString() === target.resource.toString()) {
return true; // Can not move anything onto itself
}
Expand Down

0 comments on commit bc1a048

Please sign in to comment.