]> _ Git - fluidbook-html5.git/commitdiff
wip #7898
authorsoufiane <soufiane@cubedesigners.com>
Mon, 19 Jan 2026 12:54:28 +0000 (13:54 +0100)
committersoufiane <soufiane@cubedesigners.com>
Mon, 19 Jan 2026 12:54:28 +0000 (13:54 +0100)
js/libs/fluidbook/cart/fluidbook.cart.kimplay.js
style/cart/kimplay.less

index 24c50e89b2b268e8551af4700f6f1bfff0e4d096..b104ff21bd8a0bf81d81f7395cf0edff60cdd098 100644 (file)
@@ -11,6 +11,7 @@ FluidbookCartKimplay.prototype = {
     init: function () {
         var $this = this;
         this.items = this.fluidbook.cache.get('cart', {});
+
         $(document).on(this.fluidbook.input.clickEvent, '#open-request', function () {
             let input = $(this).closest('#kimplaycart').find('[name=qty]');
             $.each(input, function (i, item) {
@@ -29,11 +30,12 @@ FluidbookCartKimplay.prototype = {
 
         $(document).on(this.fluidbook.input.clickEvent, '#kimplay-additem button', function () {
             let form = $(this).closest('#kimplay-additem');
-            $this.items['' + $(this).data('ref')] = {
+            $this.items[''+$(this).data('ref')] = {
                 name: $(form).find('h3').text(),
                 quantity: $(form).find('[name=qty]').val(),
                 comment: $(form).find('[name=comment]').val()
             };
+
             $this.fluidbook.tooltip.displayTooltipDuring($this.fluidbook.l10n.__("the item has been added to your cart"), 2500);
             $this.fluidbook.menu.closeView();
             $this.save();
@@ -41,7 +43,7 @@ FluidbookCartKimplay.prototype = {
     },
 
     emptyCart: function () {
-        this.items = [];
+        this.items = {};
         this.updateCart();
         this.save();
         resize();
@@ -59,7 +61,7 @@ FluidbookCartKimplay.prototype = {
         }
 
         let view = `<div id="kimplay-additem">
-    ${this.fluidbook.menu.getCaption("", 'small')}
+        ${this.fluidbook.menu.getCaption("", 'small')}
             <div class="content">
                 <div class="image"><img src="${this.data[ref].image}" /></div>
                     <div class="form">
index 14d4ae54d3353740cc1ddddf1dfb04a4671a3f93..b5dc19b2e538ef08e639482f09990d1e5b190721 100644 (file)
 
 #kimplaycart {
 
+  .caption a.back.small {
+    right: -10px;
+  }
+
   &table {
     margin-left: 0;
   }