From: Vincent Vanwaelscappel Date: Tue, 17 Nov 2020 12:14:18 +0000 (+0100) Subject: wait #4069 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=47056e193ef4c7567fda240665fb2e043ba4dfa8;p=fluidbook-html5.git wait #4069 @0.5 --- 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();