Amazingly improve NestedContent non-support of some editors

This commit is contained in:
Stephan
2017-06-05 11:33:05 +02:00
parent 3a990d9cf0
commit 31f8213460
3 changed files with 60 additions and 21 deletions

View File

@@ -3,6 +3,22 @@
text-align: center;
}
.nested-content--not-supported
{
opacity: 0.3;
pointer-events: none;
}
.nested-content-overlay
{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
}
.nested-content__item
{
position: relative;

View File

@@ -265,6 +265,17 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop
});
}
var notSupported = [
"Umbraco.CheckBoxList",
"Umbraco.DropDownMultiple",
"Umbraco.MacroContainer",
"Umbraco.RadioButtonList",
"Umbraco.MultipleTextstring",
"Umbraco.Tags",
"Umbraco.UploadField",
"Umbraco.ImageCropper"
];
// Initialize
var scaffoldsLoaded = 0;
$scope.scaffolds = [];
@@ -276,7 +287,15 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop
});
scaffold.tabs = [];
if (tab) {
scaffold.tabs.push(tab);
scaffold.tabs.push(tab);
angular.forEach(tab.properties,
function(property) {
if (_.find(notSupported, function (x) { return x === property.editor; })) {
property.notSupported = true;
property.notSupportedMessage = "Property " + property.label + " uses editor " + property.editor + " which is not supported by NestedContent.";
}
});
}
// Store the scaffold object

View File

@@ -1,9 +1,13 @@
<div class="umb-pane">
<div ng-repeat="property in tab.properties" style="position: relative;">
<umb-property
property="property"
ng-repeat="property in tab.properties">
<umb-editor model="property"></umb-editor>
<umb-property property="property" ng-class="{'nested-content--not-supported': property.notSupported}">
<umb-editor model="property"></umb-editor>
</umb-property>
<div ng-if="property.notSupported" class="nested-content-overlay"></div>
<p ng-if="property.notSupported">{{property.notSupportedMessage}}</p>
</div>
</div>