Fixes to MultiNodePicker when using media.

This commit is contained in:
Claus
2015-11-20 13:17:28 +01:00
parent 9fee3f5873
commit 9521742254
4 changed files with 19 additions and 13 deletions

View File

@@ -76,6 +76,7 @@ function contentPickerController($scope, dialogService, entityResource, editorSt
? "Media"
: "Document";
$scope.allowOpenButton = entityType === "Document" || entityType === "Media";
$scope.allowEditButton = entityType === "Document";
//the dialog options for the picker
var dialogOptions = {

View File

@@ -13,9 +13,9 @@
{{node.name}}
</a>
<div ng-if="!dialogEditor && ((model.config.showOpenButton && allowOpenButton) || model.config.showEditButton)">
<small ng-if="model.config.showOpenButton && allowOpenButton"><a href ng-click="showNode($index)" ng-attr-title="{{model.config.showPathOnHover && 'Path: ' + node.path || undefined}}"><localize key="open">Open</localize></a></small>
<small ng-if="model.config.showEditButton"><a href umb-launch-mini-editor="node"><localize key="edit">Edit</localize></a></small>
<div ng-if="!dialogEditor && ((model.config.showOpenButton && allowOpenButton) || (model.config.showEditButton && allowEditButton))">
<small ng-if="model.config.showOpenButton && allowOpenButton"><a href ng-click="showNode($index)"><localize key="open">Open</localize></a></small>
<small ng-if="model.config.showEditButton && allowEditButton"><a href umb-launch-mini-editor="node"><localize key="edit">Edit</localize></a></small>
</div>
</li>
</ul>

View File

@@ -12,9 +12,9 @@ namespace Umbraco.Web.PropertyEditors
{
_internalPreValues = new Dictionary<string, object>
{
{"startNodeId", "-1"},
{"showOpenButton", "0"},
{"showEditButton", "0"},
{"startNodeId", "-1"},
{"showPathOnHover", "0"}
};
}

View File

@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
@@ -15,10 +11,12 @@ namespace Umbraco.Web.PropertyEditors
public MultiNodeTreePickerPropertyEditor()
{
_internalPreValues = new Dictionary<string, object>
{
{"multiPicker", "1"},
{"showEditButton", "0"}
};
{
{"multiPicker", "1"},
{"showOpenButton", "0"},
{"showEditButton", "0"},
{"showPathOnHover", "0"}
};
}
protected override PreValueEditor CreatePreValueEditor()
@@ -47,9 +45,16 @@ namespace Umbraco.Web.PropertyEditors
[PreValueField("maxNumber", "Maximum number of items", "number")]
public string MaxNumber { get; set; }
[PreValueField("showOpenButton", "Show open button", "boolean")]
public string ShowOpenButton { get; set; }
[PreValueField("showEditButton", "Show edit button (this feature is in preview!)", "boolean")]
public string ShowEditButton { get; set; }
[PreValueField("showPathOnHover", "Show path when hovering items", "boolean")]
public bool ShowPathOnHover { get; set; }
/// <summary>
/// This ensures the multiPicker pre-val is set based on the maxNumber of nodes set
/// </summary>