]> _ Git - fluidbook-html5.git/commitdiff
wait #5259 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 3 May 2022 14:50:47 +0000 (16:50 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 3 May 2022 14:50:47 +0000 (16:50 +0200)
js/libs/fluidbook/cart/fluidbook.cart.thiriet.js
js/libs/fluidbook/fluidbook.cart.js
style/cart.less

index e9e2688f431954f1d54e45606f8422a02be6db33..12f1405f6e7a0b27fec16788948d02168857b3e8 100644 (file)
@@ -10,7 +10,11 @@ FluidbookCartThiriet.prototype = {
         $(document).on(this.fluidbook.input.clickEvent, '[data-cart-ref] .add', function () {
             var ref = $(this).closest('[data-cart-ref]').data('cart-ref');
             try {
-                plusProduct(ref);
+                if(ref.indexOf('list_')===0){
+                    listProducts(ref.substring(5));
+                }else {
+                    plusProduct(ref);
+                }
             } catch (e) {
                 console.warn('plusProduct(' + ref + ') failed');
                 console.error(e);
@@ -31,7 +35,11 @@ FluidbookCartThiriet.prototype = {
         $(document).on(this.fluidbook.input.clickEvent, '[data-cart-ref].overlay', function () {
             var ref = $(this).data('cart-ref');
             try {
-                infoProduct(ref);
+                if(ref.indexOf('list_')===0){
+                    listProducts(ref.substring(5));
+                }else {
+                    infoProduct(ref);
+                }
             } catch (e) {
                 console.warn('infoProduct(' + ref + ') failed');
                 console.error(e);
index 19184caf327e491de024d9ab51d5b022ced30a58..d4b2541d79cdbaabb1de08391fb174fa005d768f 100644 (file)
@@ -81,8 +81,13 @@ FluidbookCart.prototype = {
 
         if (this.fluidbook.settings.cartLinkAppearance === 'overlay') {
             $('a[data-cart-ref]').each(function () {
-                var size = 2;
                 var c = [];
+                var haveMinus = true;
+                if ($(this).data('cart-ref').indexOf('list_') === 0) {
+                    c.push('no-minus');
+                    haveMinus = false;
+                }
+                var size = 2;
                 if ($(this).outerWidth() < 200) {
                     size = Math.min(size, 0);
                     c.push('small-w');
@@ -114,6 +119,10 @@ FluidbookCart.prototype = {
                     $(this).addClass('medium');
                 }
                 $(this).addClass(c);
+                if (!haveMinus) {
+                    bh *= 1.25;
+                    bw = bh;
+                }
 
                 var paddingTop = 0.5 * ($(this).outerHeight() - bh);
                 var paddingLeft = 0.5 * ($(this).outerWidth() - bw);
index 5672ee840720ee0c5515a9c046374fd7ac4ac7e7..e0f95b794a718684bfcfb8f9091b16d46e15de12 100644 (file)
@@ -6,6 +6,18 @@ a[data-cart-ref] {
     overflow: hidden;
     color: #fff;
 
+    &.no-minus {
+      div.remove {
+        display: none !important;
+      }
+
+      div.add {
+        margin-left: 0 !important;
+        transform-origin: 0 0;
+        transform: scale(1.25);
+      }
+    }
+
     &.condensed-h {
       div {
         &.infos {