diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml index 5f4893976663..2e09b649ba4d 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en.xml @@ -294,6 +294,7 @@ Content. Are you sure you want to delete all items? + Are you sure you want to delete this item? No Content Types are configured for this property. Add Element Type Select Element Type @@ -331,6 +332,7 @@ Select the date and time to publish and/or unpublish the content item. Create new Paste from clipboard + Remove item This item is in the Recycle Bin No content can be added for this item Save is not allowed diff --git a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml index f86b0825139c..b9ce1dd2c7f8 100644 --- a/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml +++ b/src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml @@ -290,6 +290,7 @@ What does this mean?]]> Are you sure you want to delete this item? Are you sure you want to delete all items? + Are you sure you want to delete this item? Property %0% uses editor %1% which is not supported by Nested Content. @@ -330,6 +331,7 @@ Select the date and time to publish and/or unpublish the content item. Create new Paste from clipboard + Remove item This item is in the Recycle Bin Save is not allowed Publish is not allowed diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js index 4ebb3ea2a9c8..62c300d7902a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/blocklist/umbBlockListPropertyEditor.component.js @@ -37,6 +37,9 @@ let copyAllBlocksAction = null; let deleteAllBlocksAction = null; let pasteSingleBlockAction = null; + let resetSingleBlock = null; + + let scopeOfExistence = null; var inlineEditing = false; var liveEditing = true; @@ -124,12 +127,12 @@ vm.listWrapperStyles['max-width'] = vm.model.config.maxPropertyWidth; } - // We need to ensure that the property model value is an object, this is needed for modelObject to recive a reference and keep that updated. + // We need to ensure that the property model value is an object, this is needed for modelObject to receive a reference and keep that updated. if (typeof vm.model.value !== 'object' || vm.model.value === null) {// testing if we have null or undefined value or if the value is set to another type than Object. vm.model.value = {}; } - var scopeOfExistence = $scope; + scopeOfExistence = $scope; if (vm.umbVariantContentEditors && vm.umbVariantContentEditors.getScope) { scopeOfExistence = vm.umbVariantContentEditors.getScope(); } else if(vm.umbElementEditorContent && vm.umbElementEditorContent.getScope) { @@ -179,9 +182,18 @@ useLegacyIcon: false }; + resetSingleBlock = { + labelKey: "content_removeItem", + labelTokens: [], + icon: "icon-trash", + method: requestResetSingleBlock, + isDisabled: false, + useLegacyIcon: false + }; + var propertyActions = [copyAllBlocksAction, deleteAllBlocksAction]; - var propertyActionsForSingleBlockMode = [pasteSingleBlockAction]; + var propertyActionsForSingleBlockMode = [pasteSingleBlockAction, resetSingleBlock]; if (vm.umbProperty) { if (vm.singleBlockMode) { @@ -844,6 +856,24 @@ }); } + function requestResetSingleBlock() { + localizationService.localizeMany(["content_nestedContentDeleteItem", "general_delete"]).then(function (data) { + overlayService.confirmDelete({ + title: data[1], + content: data[0], + close: function () { + overlayService.close(); + }, + submit: function () { + deleteAllBlocks(); + modelObject = blockEditorService.createModelObject(vm.model.value, vm.model.editor, vm.model.config.blocks, scopeOfExistence, $scope); + modelObject.load().then(onLoaded); + overlayService.close(); + } + }); + }); + } + function openSettingsForBlock(block, blockIndex, parentForm) { editBlock(block, true, blockIndex, parentForm); }