Enables listview children in dialog trees

By default trees doesnt show children of listview nodes, this enables
them in dialog trees, otherwise content pickers cannot select childrens
of a listview node
This commit is contained in:
perploug
2014-01-27 22:03:52 +01:00
parent e17b32c6e5
commit c2d978a0db
3 changed files with 8 additions and 3 deletions

View File

@@ -98,7 +98,8 @@ namespace Umbraco.Web.Trees
{
//Special check to see if it ia a container, if so then we'll hide children.
var isContainer = e.IsContainer();
//we only perform this check for non-dialog trees since pickers needs access to these nodes
var isContainer = e.IsContainer() && (queryStrings.Get("isDialog") != "true");
var node = CreateTreeNode(
e.Id.ToInvariantString(),

View File

@@ -177,11 +177,13 @@ namespace Umbraco.Web.Trees
//before we get the children we need to see if this is a container node
var current = Services.EntityService.Get(int.Parse(id), UmbracoObjectType);
if (current != null && current.IsContainer())
if (queryStrings.Get("isDialog") != "true" && current != null && current.IsContainer())
{
//no children!
return new TreeNodeCollection();
}
return PerformGetTreeNodes(id, queryStrings);
}

View File

@@ -78,7 +78,7 @@ namespace Umbraco.Web.Trees
var entity = (UmbracoEntity)e;
//Special check to see if it ia a container, if so then we'll hide children.
var isContainer = entity.IsContainer();
var isContainer = e.IsContainer() && (queryStrings.Get("isDialog") != "true");
var node = CreateTreeNode(
e.Id.ToInvariantString(),
@@ -89,6 +89,8 @@ namespace Umbraco.Web.Trees
entity.HasChildren && (isContainer == false));
node.AdditionalData.Add("contentType", entity.ContentTypeAlias);
if (isContainer)
node.SetContainerStyle();