Don't show NC delete confirmation if an item can't be deleted

This commit is contained in:
Kenn Jacobsen
2019-09-09 19:40:08 +02:00
committed by Sebastiaan Janssen
parent a51f7b29de
commit 3f4bff9ac3
2 changed files with 12 additions and 5 deletions

View File

@@ -154,6 +154,11 @@
.umb-nested-content__icon--disabled {
opacity: 0.3;
cursor: default !important;
&:hover {
color: @ui-option-type;
}
}

View File

@@ -271,13 +271,15 @@ angular.module("umbraco").controller("Umbraco.PropertyEditors.NestedContent.Prop
};
$scope.deleteNode = function (idx) {
if ($scope.nodes.length > $scope.model.config.minItems) {
$scope.nodes.splice(idx, 1);
$scope.setDirty();
updateModel();
}
$scope.nodes.splice(idx, 1);
$scope.setDirty();
updateModel();
};
$scope.requestDeleteNode = function (idx) {
if ($scope.nodes.length <= $scope.model.config.minItems) {
return;
}
if ($scope.model.config.confirmDeletes === true) {
localizationService.localizeMany(["content_nestedContentDeleteItem", "general_delete", "general_cancel", "contentTypeEditor_yesDelete"]).then(function (data) {
const overlay = {