Skip to content

Commit

Permalink
Change event to fire the same event on toggling
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Dec 12, 2024
1 parent 0cf0831 commit 7d8beb2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Resources/public/js/wishlist-action-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ class WishlistActionHandler {
element.dataset.url = json.toggleUrl;
element.classList.toggle('ssw-added', json.event === 'added');

element.dispatchEvent(new CustomEvent(`ssw:product-${json.event}`, {
element.dispatchEvent(new CustomEvent(`ssw:product-toggled`, {
bubbles: true,
detail: {
event: json.event,
wishlistItemsCount: json.wishlistItemsCount,
},
}));
Expand Down

0 comments on commit 7d8beb2

Please sign in to comment.