Skip to content

Commit

Permalink
Merge d764be6 into a5ad431
Browse files Browse the repository at this point in the history
  • Loading branch information
myronenko committed Jul 16, 2023
2 parents a5ad431 + d764be6 commit bd8fd60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
},
Expand Down

0 comments on commit bd8fd60

Please sign in to comment.