Fixes the new Id/Guid property on members, ensures all tabs are expanded by default and removes that init logic from JS since we don't want it there.

This commit is contained in:
Shannon
2018-10-23 19:25:48 +11:00
parent 1936cc5be9
commit 69450791cf
7 changed files with 10 additions and 20 deletions

View File

@@ -22,14 +22,6 @@
},
link: function(scope) {
function onInit() {
angular.forEach(scope.content.tabs, function (group) {
group.open = true;
});
}
onInit();
},
scope: {
content: "="

View File

@@ -5,14 +5,6 @@
var vm = this;
function onInit() {
angular.forEach($scope.content.tabs, function(group){
group.open = true;
});
}
onInit();
}
angular.module("umbraco").controller("Umbraco.Editors.Media.Apps.ContentController", MediaAppContentController);

View File

@@ -1,5 +1,5 @@
<div class="form-horizontal" ng-controller="Umbraco.Editors.Media.Apps.ContentController as vm">
<div class="umb-expansion-panel" data-element="group-{{group.alias}}" ng-repeat="group in content.tabs | filter: { hide : '!' + true }">
<div class="umb-expansion-panel" data-element="group-{{group.alias}}" ng-repeat="group in content.tabs | filter: { hide : '!' + true } track by group.label">
<div class="umb-expansion-panel__header" ng-click="group.open = !group.open">
<div>{{ group.label }}</div>

View File

@@ -18,7 +18,7 @@
<umb-editor-container class="form-horizontal">
<div class="umb-expansion-panel" ng-repeat="group in content.tabs">
<div class="umb-expansion-panel" ng-repeat="group in content.tabs track by group.label">
<div class="umb-expansion-panel__header" ng-click="group.open = !group.open">
<div>{{ group.label }}</div>

View File

@@ -1,4 +1,4 @@
<div class="umb-editor umb-readonlyvalue umb-idwithguidvalue" ng-controller="Umbraco.PropertyEditors.IdWithGuidValueController">
<div class="umb-property-editor umb-readonlyvalue" ng-controller="Umbraco.PropertyEditors.IdWithGuidValueController">
<div>{{ displayid }}</div>
<small>{{ displayguid }}</small>
</div>

View File

@@ -21,6 +21,12 @@ namespace Umbraco.Web.Models.ContentEditing
[DataMember(Name = "alias")]
public string Alias { get; set; }
/// <summary>
/// The expanded state of the tab
/// </summary>
[DataMember(Name = "open")]
public bool Expanded { get; set; } = true;
[DataMember(Name = "properties")]
public IEnumerable<T> Properties { get; set; }
}

View File

@@ -119,7 +119,7 @@ namespace Umbraco.Web.Models.Mapping
{
new ContentPropertyDisplay
{
Alias = string.Format("{0}id", Constants.PropertyEditors.InternalGenericPropertiesPrefix),
Alias = $"{Constants.PropertyEditors.InternalGenericPropertiesPrefix}id",
Label = _localizedTextService.Localize("general/id"),
Value = new List<string> {member.Id.ToString(), member.Key.ToString()},
View = "idwithguid"