Skip to content

Commit

Permalink
fix: change _.invoke calls to forEach
Browse files Browse the repository at this point in the history
  • Loading branch information
shaveko committed Oct 12, 2023
1 parent 8128a77 commit c3dddb6
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ const _createPath = function _createPath(interaction, srcElement, destElement, o
interaction._vsets.push(vset);

//to identify the element of the set outside the context
_.invoke(vset, 'data', 'assoc-path', true);
vset.forEach(el => {
el.data('assoc-path', true);
});

//enable to select the path by clicking the invisible layer
layer.click(function selectLigne() {
Expand Down Expand Up @@ -145,7 +147,7 @@ const _createPath = function _createPath(interaction, srcElement, destElement, o

//remove set handler
function removeSet() {
_.invoke(vset, 'remove');
vset.forEach(vset.remove());
interaction._vsets = _.without(interaction._vsets, vset);
if (typeof onRemove === 'function') {
onRemove();
Expand Down Expand Up @@ -424,7 +426,6 @@ const setResponse = function (interaction, response) {
*/
const resetResponse = function resetResponse(interaction) {
const toRemove = [];

//reset response and state bound to shapes
_.forEach(interaction.getChoices(), function (choice) {
const element = interaction.paper.getById(choice.serial);
Expand All @@ -445,7 +446,7 @@ const resetResponse = function resetResponse(interaction) {
}
});
}
_.invoke(toRemove, 'remove');
toRemove.forEach(el => el.remove());
};

/**
Expand Down

0 comments on commit c3dddb6

Please sign in to comment.