working on U4-5687 Fix issues with mini content editor that is launched from new Edit button in MNTP
This commit is contained in:
@@ -13,6 +13,7 @@ angular.module('umbraco')
|
||||
//configuration
|
||||
$scope.cfg = {
|
||||
multiPicker: "0",
|
||||
showEditButton: "0",
|
||||
entityType: "Document",
|
||||
filterCssClass: "not-allowed not-published",
|
||||
|
||||
@@ -29,6 +30,7 @@ angular.module('umbraco')
|
||||
|
||||
//Umbraco persists boolean for prevalues as "0" or "1" so we need to convert that!
|
||||
$scope.cfg.multiPicker = ($scope.cfg.multiPicker === "0" ? false : true);
|
||||
$scope.cfg.showEditButton = ($scope.cfg.showEditButton === "0" ? false : true);
|
||||
|
||||
if ($scope.cfg.startNode.type === "member") {
|
||||
$scope.cfg.entityType = "Member";
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<i class="{{node.icon}} hover-hide"></i>
|
||||
{{node.name}}
|
||||
</a>
|
||||
<div ng-if="!dialogEditor">
|
||||
<div ng-if="!dialogEditor && cfg.showEditButton">
|
||||
<small><a href umb-launch-mini-editor="node">Edit</a></small>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Umbraco.Core;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Web.PropertyEditors
|
||||
@@ -6,5 +7,32 @@ namespace Umbraco.Web.PropertyEditors
|
||||
[PropertyEditor(Constants.PropertyEditors.ContentPickerAlias, "Content Picker", "INT", "contentpicker", IsParameterEditor = true)]
|
||||
public class ContentPickerPropertyEditor : PropertyEditor
|
||||
{
|
||||
|
||||
public ContentPickerPropertyEditor()
|
||||
{
|
||||
_internalPreValues = new Dictionary<string, object>
|
||||
{
|
||||
{"showEditButton", "0"}
|
||||
};
|
||||
}
|
||||
|
||||
private IDictionary<string, object> _internalPreValues;
|
||||
public override IDictionary<string, object> DefaultPreValues
|
||||
{
|
||||
get { return _internalPreValues; }
|
||||
set { _internalPreValues = value; }
|
||||
}
|
||||
|
||||
protected override PreValueEditor CreatePreValueEditor()
|
||||
{
|
||||
return new ContentPickerPreValueEditor();
|
||||
}
|
||||
|
||||
internal class ContentPickerPreValueEditor : PreValueEditor
|
||||
{
|
||||
[PreValueField("showEditButton", "Show edit button", "boolean")]
|
||||
public string ShowEditButton { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,8 @@ namespace Umbraco.Web.PropertyEditors
|
||||
{
|
||||
_internalPreValues = new Dictionary<string, object>
|
||||
{
|
||||
{"multiPicker", "1"}
|
||||
{"multiPicker", "1"},
|
||||
{"showEditButton", "0"}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -46,6 +47,9 @@ namespace Umbraco.Web.PropertyEditors
|
||||
[PreValueField("maxNumber", "Maximum number of items", "number")]
|
||||
public string MaxNumber { get; set; }
|
||||
|
||||
[PreValueField("showEditButton", "Show edit button", "boolean")]
|
||||
public string ShowEditButton { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This ensures the multiPicker pre-val is set based on the maxNumber of nodes set
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user