]> _ Git - fluidbook-html5.git/commitdiff
wait #7898 @1:00
authorsoufiane <soufiane@cubedesigners.com>
Wed, 21 Jan 2026 11:04:58 +0000 (12:04 +0100)
committersoufiane <soufiane@cubedesigners.com>
Wed, 21 Jan 2026 11:04:58 +0000 (12:04 +0100)
js/libs/fluidbook/cart/fluidbook.cart.kimplay.js
style/cart/kimplay.less

index 848123451cf11e7d8abf23c5deeb18b720c36aae..428aabc79dc128545c4b67c94267004816de6789 100644 (file)
@@ -4,6 +4,8 @@ function FluidbookCartKimplay(cart) {
     this.data = this.fluidbook.settings.basketReferences;
     this.showAddToCartTooltips = false;
     this.items = {};
+    this.formDataStorage = window.localStorage.getItem('formData')
+    this.ps = null;
     this.init();
 }
 
@@ -127,6 +129,15 @@ FluidbookCartKimplay.prototype = {
         return res;
     },
 
+    setFormData: function () {
+        const form = document.getElementById("kimplay-sendcart-form");
+        if(!form) {
+            return false;
+        }
+        const formData = new FormData(form);
+        window.localStorage.setItem('formData', JSON.stringify(formData))
+    },
+
     updateCart: function () {
         if ($('#kimplaycart').length > 0) {
             $('#kimplaycart .content').html(this.getCartContent());
@@ -143,9 +154,11 @@ FluidbookCartKimplay.prototype = {
     },
 
     openCart: function (p2, callback) {
+        console.log('okkkk')
         this._endMenu(this.fluidbook.l10n.__('my selection'), this.getCartContent(), function () {
             callback();
         });
+        setTimeout(() => this.ps.update(), 500)
     },
 
     getCartContent: function () {
@@ -210,6 +223,7 @@ FluidbookCartKimplay.prototype = {
         view += '</div>';
         view += '</div>';
         this.fluidbook.menu.viewWrap(view, 'cart');
+        this.ps = new PerfectScrollbar("#kimplaycart .content");
         callback();
     },
 
@@ -240,35 +254,47 @@ FluidbookCartKimplay.prototype = {
     },
 
     getContactForm: function() {
+        let data = JSON.parse(this.formDataStorage);
+        if(!data) {
+            data = {
+                'company':'',
+                'name':'',
+                'firstname':'',
+                'mail':'',
+                'phone':'',
+                'address':'',
+            }
+        }
+
         let view = `<div id="kimplay-sendcart">
         ${this.fluidbook.menu.getCaption("Mes coordonnées", 'small')}
             <div class="content">
                 <form id="kimplay-sendcart-form">
                     <div class="form-group">
                         <label for="company">Nom de l'entreprise*</label>
-                        <input type="text" id="company" name="company">
+                        <input type="text" id="company" name="company" value="${data.company}">
                     </div>
                     <br>
                     <div class="form-group">
                         <label for="name">Nom*</label>
-                        <input type="text" name="name">
+                        <input type="text" name="name" value="${data.name}">
                     </div><br>
                     <div class="form-group">
                         <label for="firstname">Prénom</label>
-                        <input type="text" name="firstname">
+                        <input type="text" name="firstname" value="${data.firstname}">
                     </div>
                     <br>
                     <div class="form-group">
                         <label for="mail">Email*</label>
-                        <input type="email" name="mail">
+                        <input type="email" name="mail" value="${data.mail}">
                     </div><br>
                     <div class="form-group">
                         <label for="phone">Téléphone*</label>
-                        <input type="text" name="phone">
+                        <input type="text" name="phone" value="${data.phone}">
                     </div><br>
                     <div class="form-group">
                         <label for="address">Adresse</label>
-                        <input type="text" name="address">
+                        <input type="text" name="address" value="${data.address}">
                     </div><br>
                     <div class="form-group textarea">
                         <label for="message">Message</label>
index 6789b352d68be5ee4b041b3b5449759c7f3c17c7..71f6964a79a944a96baf159243aff6745e64464c 100644 (file)
 
 #kimplaycart {
 
-  .caption a.back.small {
-    right: -10px;
+  .caption {
+    padding-right: 10px;
+
+    a.back.small {
+      right: -10px;
+    }
+  }
+
+  .ps__rail-x {
+    display: none;
+  }
+
+  .ps__rail-y,
+  .ps__thumb-y {
+    width: 5px;
+    opacity: 1;
+  }
+
+  &:has(.ps__rail-y) #wrap-kimplaycart {
+    padding-right: 5px;
+  }
+
+  .ps__rail-y {
+    background-color: #bce9e9;
+  }
+
+  .ps__thumb-y {
+    background-color: #7dd4e6;
+    right: 0;
   }
 
   &table {
 
       &.image {
         width: 130px;
+        padding-right: 20px;
+        padding-left: 20px;
       }
 
       &.reference,
     }
 
     input, textarea {
-      width: 320px;
+      width: 380px;
       text-align: left;
       padding: 5px 10px;
       font-size: 14px;