From 602915a31191c4d317d468cd05e0b5c2bdf6d168 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 22 Oct 2015 17:47:22 +0200 Subject: [PATCH] makes FolderBrowserPropertyEditor have the grid as the primary layout for the list view. --- .../FolderBrowserPropertyEditor.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Umbraco.Web/PropertyEditors/FolderBrowserPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/FolderBrowserPropertyEditor.cs index 12b6327369..95dbd28940 100644 --- a/src/Umbraco.Web/PropertyEditors/FolderBrowserPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/FolderBrowserPropertyEditor.cs @@ -1,4 +1,6 @@ using System; +using System.Collections; +using System.Collections.Generic; using System.ComponentModel; using System.Web.Mvc; using Umbraco.Core; @@ -16,5 +18,24 @@ namespace Umbraco.Web.PropertyEditors return new PreValueEditor(); } + public override IDictionary DefaultPreValues + { + get + { + var defaults = base.DefaultPreValues; + + //make the grid the default layout for media + if (defaults.ContainsKey("layouts") && defaults["layouts"] is IEnumerable) + { + defaults["layouts"] = new[] + { + new {name = "Grid", path = "views/propertyeditors/listview/layouts/grid/grid.html", icon = "icon-thumbnails-small", isSystem = 1, selected = true}, + new {name = "List", path = "views/propertyeditors/listview/layouts/list/list.html", icon = "icon-list", isSystem = 1, selected = true} + }; + } + + return defaults; + } + } } } \ No newline at end of file