Property-Action for Remove All Entries in Nested Content (#7036)
* Property-Action for remove all entries from Nested Content * Add "delete all items" confirmation and rephrase action link a bit * Enforce "delete" confirmation type in overlayService.confirmDelete * rename to controller for easier to solve merge conflicts * update removeAllEntriesAction.isDisabled when content changes * minor correction
This commit is contained in:
@@ -89,6 +89,7 @@
|
||||
}
|
||||
|
||||
function confirmDelete(overlay) {
|
||||
overlay.confirmType = "delete";
|
||||
confirm(overlay);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,33 @@
|
||||
}
|
||||
|
||||
|
||||
var removeAllEntries = function () {
|
||||
localizationService.localizeMany(["content_nestedContentDeleteAllItems", "general_delete"]).then(function (data) {
|
||||
overlayService.confirmDelete({
|
||||
title: data[1],
|
||||
content: data[0],
|
||||
close: function () {
|
||||
overlayService.close();
|
||||
},
|
||||
submit: function () {
|
||||
vm.nodes = [];
|
||||
setDirty();
|
||||
updateModel();
|
||||
overlayService.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var removeAllEntriesAction = {
|
||||
labelKey: 'clipboard_labelForRemoveAllEntries',
|
||||
labelTokens: [],
|
||||
icon: 'trash',
|
||||
method: removeAllEntries,
|
||||
isDisabled: true
|
||||
}
|
||||
|
||||
|
||||
|
||||
// helper to force the current form into the dirty state
|
||||
function setDirty() {
|
||||
@@ -535,12 +562,14 @@
|
||||
|
||||
function updatePropertyActionStates() {
|
||||
copyAllEntriesAction.isDisabled = !model.value || model.value.length === 0;
|
||||
removeAllEntriesAction.isDisabled = model.value.length === 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var propertyActions = [
|
||||
copyAllEntriesAction
|
||||
copyAllEntriesAction,
|
||||
removeAllEntriesAction
|
||||
];
|
||||
|
||||
this.$onInit = function () {
|
||||
Reference in New Issue
Block a user