From 47056e193ef4c7567fda240665fb2e043ba4dfa8 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 17 Nov 2020 13:14:18 +0100 Subject: [PATCH] wait #4069 @0.5 --- js/libs/fluidbook/cart/fluidbook.cart.puma.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/js/libs/fluidbook/cart/fluidbook.cart.puma.js b/js/libs/fluidbook/cart/fluidbook.cart.puma.js index f526c2a1..f92aa37f 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.puma.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.puma.js @@ -1,5 +1,3 @@ - - function FluidbookCartPuma(cart) { var $this = this; this.cart = cart; @@ -32,13 +30,20 @@ FluidbookCartPuma.prototype = { this.save(); return this.fluidbook.l10n.__("the item has been added to your cart"); } else { - this.removeFromCart(ref); + this.removeFromCartByRef(ref); return this.fluidbook.l10n.__("the item has been removed from your cart"); } }, - removeFromCart: function (ref) { + removeFromCartByRef: function (ref) { var key = this.items.indexOf(ref); + if (key >= 0) { + this.removeFromCart(key) + } + }, + + removeFromCart: function (key) { + console.log(key); if (key >= 0) { this.items.splice(key, 1); this.save(); -- 2.39.5