From 7d8beb237b451fee69e041ef5f088d76976be875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20L=C3=B8vgaard?= Date: Thu, 12 Dec 2024 09:26:04 +0100 Subject: [PATCH] Change event to fire the same event on toggling --- src/Resources/public/js/wishlist-action-handler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Resources/public/js/wishlist-action-handler.js b/src/Resources/public/js/wishlist-action-handler.js index c6085fc..0d565db 100644 --- a/src/Resources/public/js/wishlist-action-handler.js +++ b/src/Resources/public/js/wishlist-action-handler.js @@ -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, }, }));