Skip to content

Commit

Permalink
Merge pull request #37 from Sitecore/bug/delete-interactions-not-working
Browse files Browse the repository at this point in the history
Updated Contacts.js so that deleting contact interactions now works in SPEAK app
  • Loading branch information
jeanfrancoislarente committed Oct 29, 2018
2 parents 3736b80 + eedf4b3 commit a0c0750
Showing 1 changed file with 5 additions and 7 deletions.
Expand Up @@ -49,18 +49,16 @@ define(["sitecore", "knockout", "underscore", "/-/speak/v1/experienceGenerator/I
deleteSelected: function(controlName) {
var control = this[controlName];
var filteredItem = control.get("items");

var checkedItems = control.get("checkedItems");

filteredItem = _.difference(filteredItem, checkedItems);

control.unset("items", { silent: true });
control.set("items", filteredItem);
control.set("items", checkedItems);
if (controlName === "InteractionList") {
this.ContactList.get("selectedItem").set("interactions", filteredItem);

var interactions = this.ContactList.get("selectedItem").get("interactions");
_.each(checkedItems, function (item) { interactions.splice(interactions.indexOf(item), 1) });
this.setInteractions(interactions);
}

control.viewModel.uncheckItems(control.get("checkedItems"));
},
duplicateSelected: function(controlName) {
var control = this[controlName];
Expand Down

0 comments on commit a0c0750

Please sign in to comment.