Skip to content

Commit

Permalink
mutation impact is 'removed' if the node is replaced with nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
longhotsummer committed Jan 14, 2025
1 parent 11f86e3 commit 5b533ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions indigo_app/static/javascript/indigo/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@

if (mutation.type === 'childList') {
if (mutation.removedNodes[0] === element) {
if (mutation.addedNodes.length === 0) {
// the element itself was removed
return 'removed';
}

// the element has been replaced
return 'replaced';
}
Expand Down

0 comments on commit 5b533ba

Please sign in to comment.