diff --git a/README.md b/README.md index 24738ef2b0..4bcba15925 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ With AEM as a Cloud Service SDK, use the `cloud` profile as follows to deploy th Note that: * `-pl/-projects` option specifies the list of projects that you want to install -* `-am/-also-make` options specifies that dependencies should also be built +* `-am/-also-make` option specifies the dependencies that should also be built For detailed informations see [BUILDING.md](BUILDING.md). diff --git a/content/src/content/jcr_root/apps/core/wcm/components/commons/editor/dialog/childreneditor/v1/childreneditor/clientlibs/js/childreneditor.js b/content/src/content/jcr_root/apps/core/wcm/components/commons/editor/dialog/childreneditor/v1/childreneditor/clientlibs/js/childreneditor.js index 54ea4abf55..a2a4e78842 100644 --- a/content/src/content/jcr_root/apps/core/wcm/components/commons/editor/dialog/childreneditor/v1/childreneditor/clientlibs/js/childreneditor.js +++ b/content/src/content/jcr_root/apps/core/wcm/components/commons/editor/dialog/childreneditor/v1/childreneditor/clientlibs/js/childreneditor.js @@ -252,25 +252,20 @@ } Coral.commons.ready(that._elements.self, function(item) { - // As a reordering of the multifield also triggers the coral-collection:remove event we have to add - // a check for moved items so the prompt get only shown on a real remove action. - var movedItem; - - that._elements.self.on("coral-multifield:itemorder", function(event) { - movedItem = event.detail.item.dataset["name"]; - }); - + // coral-collection:remove event is triggered either when the element is removed + // or when the element is moved/reordered (in that case we'll temporarily remove it + // and it will be added back by the subsequent coral-collection:add event) that._elements.self.on("coral-collection:remove", function(event) { - var name = event.detail.item.dataset["name"]; - if (movedItem !== name) { - that._deletedChildren.push(name); - } + const elementToDelete = event.detail.item.dataset["name"]; + that._deletedChildren.push(elementToDelete); }); + // coral-collection:add event is triggered either when the new element is added + // or when the element is moved/reordered (in that case we'll add back the temporarily + // removed element, hence we have to remove that element from the deleted list) that._elements.self.on("coral-collection:add", function(event) { - if (movedItem !== event.detail.item.dataset["name"]) { - movedItem = undefined; - } + const elementToAdd = event.detail.item.dataset["name"]; + that._deletedChildren = that._deletedChildren.filter(elementToDelete => elementToDelete !== elementToAdd); }); }); },