Skip to content

Commit eb97962

Browse files
authored
Render folders before files in static files picker. (#18701)
1 parent e1e5f52 commit eb97962

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Umbraco.Web.BackOffice/Trees/StaticFilesTreeController.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,6 @@ private void AddRootFolder(string directory, FormCollection queryStrings, TreeNo
9898

9999
private void AddPhysicalFiles(string path, FormCollection queryStrings, TreeNodeCollection nodes)
100100
{
101-
IEnumerable<string> files = _fileSystem.GetFiles(path)
102-
.Where(x => x.StartsWith(AppPlugins) || x.StartsWith(Webroot));
103-
104-
foreach (var file in files)
105-
{
106-
var name = Path.GetFileName(file);
107-
TreeNode node = CreateTreeNode(WebUtility.UrlEncode(file), path, queryStrings, name, Constants.Icons.DefaultIcon, false);
108-
nodes.Add(node);
109-
}
110-
111101
IEnumerable<string> directories = _fileSystem.GetDirectories(path);
112102

113103
foreach (var directory in directories)
@@ -117,6 +107,16 @@ private void AddPhysicalFiles(string path, FormCollection queryStrings, TreeNode
117107
TreeNode node = CreateTreeNode(WebUtility.UrlEncode(directory), path, queryStrings, name, Constants.Icons.Folder, hasChildren);
118108
nodes.Add(node);
119109
}
110+
111+
IEnumerable<string> files = _fileSystem.GetFiles(path)
112+
.Where(x => x.StartsWith(AppPlugins) || x.StartsWith(Webroot));
113+
114+
foreach (var file in files)
115+
{
116+
var name = Path.GetFileName(file);
117+
TreeNode node = CreateTreeNode(WebUtility.UrlEncode(file), path, queryStrings, name, Constants.Icons.DefaultIcon, false);
118+
nodes.Add(node);
119+
}
120120
}
121121

122122
private void AddWebRootFiles(string path, FormCollection queryStrings, TreeNodeCollection nodes)

0 commit comments

Comments
 (0)