From: Vincent Vanwaelscappel Date: Tue, 3 May 2022 14:50:47 +0000 (+0200) Subject: wait #5259 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=06b460fcedb90b23a9a0221acaa3182f75b7c002;p=fluidbook-html5.git wait #5259 @1.5 --- diff --git a/js/libs/fluidbook/cart/fluidbook.cart.thiriet.js b/js/libs/fluidbook/cart/fluidbook.cart.thiriet.js index e9e2688f..12f1405f 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.thiriet.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.thiriet.js @@ -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); diff --git a/js/libs/fluidbook/fluidbook.cart.js b/js/libs/fluidbook/fluidbook.cart.js index 19184caf..d4b2541d 100644 --- a/js/libs/fluidbook/fluidbook.cart.js +++ b/js/libs/fluidbook/fluidbook.cart.js @@ -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); diff --git a/style/cart.less b/style/cart.less index 5672ee84..e0f95b79 100644 --- a/style/cart.less +++ b/style/cart.less @@ -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 {