From: Vincent Vanwaelscappel Date: Fri, 12 Mar 2021 10:20:10 +0000 (+0100) Subject: wait #4344 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=aa57ca8b549df98049dc82520bbd19e6810525c9;p=fluidbook-html5.git wait #4344 @0.5 --- diff --git a/js/libs/fluidbook/cart/fluidbook.cart.puma.js b/js/libs/fluidbook/cart/fluidbook.cart.puma.js index 03bc86e3..5b62c35e 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.puma.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.puma.js @@ -23,6 +23,34 @@ FluidbookCartPuma.prototype = { } return false; }); + + $(document).on('click', '.emptyCart', function () { + $.confirm({ + backgroundDismiss: true, + title: 'Empty my cart', + content: 'Are you sure you want to empty your cart ?', + buttons: { + confirm: { + text: 'Confirm', + btnClass: 'btn-ok', + action: function () { + $this.emptyCart(); + }, + }, + cancel: function () { + + }, + } + }); + return false; + }); + }, + + emptyCart: function () { + this.items = []; + this.updateCart(); + this.save(); + resize(); }, addToCart: function (ref, quantity) { @@ -44,7 +72,6 @@ FluidbookCartPuma.prototype = { }, removeFromCart: function (key) { - console.log(key); if (key >= 0) { this.items.splice(key, 1); this.save(); @@ -126,9 +153,9 @@ FluidbookCartPuma.prototype = { content += head; content += ''; $.each(this.getItems(), function (i, ref) { - if(i%12===0 && i>0){ - content+=''; - }else { + if (i % 12 === 0 && i > 0) { + content += ''; + } else { content += ''; } $.each(columns, function (k, v) { @@ -153,7 +180,7 @@ FluidbookCartPuma.prototype = { content += ''; content += ''; content += ''; return content; diff --git a/style/cart/puma.less b/style/cart/puma.less index 44470cc8..d69d1bb6 100644 --- a/style/cart/puma.less +++ b/style/cart/puma.less @@ -9,6 +9,14 @@ display: none; } } + + .emptyCart { + float: left; + margin-left: 30px; + border: 1px solid @menu-button-background; + color: @menu-button-background; + background-color: transparent; + } } [data-type="7"] {