Files
Umbraco-CMS/src/Umbraco.Web/Trees/ScriptsTreeController.cs

28 lines
986 B
C#
Raw Normal View History

using System;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Web.Models.Trees;
namespace Umbraco.Web.Trees
{
[Tree(Constants.Applications.Settings, Constants.Trees.Scripts, "Scripts", "icon-folder", "icon-folder", sortOrder: 2)]
public class ScriptsTreeController : FileSystemTreeController
{
2017-05-12 14:49:44 +02:00
protected override IFileSystem FileSystem => Current.FileSystems.ScriptsFileSystem; // fixme inject
2017-05-12 14:49:44 +02:00
private static readonly string[] ExtensionsStatic = { "js" };
2017-05-12 14:49:44 +02:00
protected override string[] Extensions => ExtensionsStatic;
2017-05-12 14:49:44 +02:00
protected override string FileIcon => "icon-script";
2017-05-12 14:49:44 +02:00
protected override bool EnableCreateOnFolder => true;
2017-05-12 14:49:44 +02:00
protected override void OnRenderFolderNode(ref TreeNode treeNode)
{
2017-05-12 14:49:44 +02:00
//TODO: This isn't the best way to ensure a noop process for clicking a node but it works for now.
treeNode.AdditionalData["jsClickCallback"] = "javascript:void(0);";
}
}
}