]> _ Git - fluidbook-html5.git/commitdiff
wip #4259 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Apr 2022 16:05:11 +0000 (18:05 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Apr 2022 16:05:11 +0000 (18:05 +0200)
images/symbols/cart-overlay.svg
js/libs/fluidbook/cart/fluidbook.cart.thiriet.js
js/libs/fluidbook/fluidbook.cart.js
style/cart.less

index 4d6ed28ee44d7cd32074b60344e72aa2c3875b81..4088fa1a0253fdfd57e028346c8c1dd0bbfc91cd 100644 (file)
@@ -18,4 +18,8 @@
                S8.4,1,17.5,1S34,8.4,34,17.5S26.6,34,17.5,34z"/>
         <rect x="8.7" y="16.5" width="17.5" height="2"/>
     </symbol>
+    <symbol id="link-cart-info" viewBox="0 0 20 20">
+        <path d="M10,1.43c4.73,0,8.57,3.85,8.57,8.57s-3.85,8.57-8.57,8.57S1.43,14.73,1.43,10,5.27,1.43,10,1.43m0-1.43C4.48,0,0,4.48,0,10s4.48,10,10,10,10-4.48,10-10S15.52,0,10,0h0Z"/>
+        <path d="M9.27,5.67c-.19-.19-.29-.42-.29-.69s.1-.51,.29-.7,.44-.29,.73-.29,.54,.09,.73,.28c.19,.18,.29,.41,.29,.68s-.1,.52-.29,.71-.44,.29-.73,.29-.54-.09-.73-.28Zm-.02,1.89h1.51V15.88h-1.51V7.56Z"/>
+    </symbol>
 </svg>
index b8f63c888202a409663d840d761a414560bd6d6f..e9e2688f431954f1d54e45606f8422a02be6db33 100644 (file)
@@ -28,8 +28,8 @@ FluidbookCartThiriet.prototype = {
             return false;
         });
 
-        $(document).on(this.fluidbook.input.clickEvent, '[data-cart-ref] .info', function () {
-            var ref = $(this).closest('[data-cart-ref]').data('cart-ref');
+        $(document).on(this.fluidbook.input.clickEvent, '[data-cart-ref].overlay', function () {
+            var ref = $(this).data('cart-ref');
             try {
                 infoProduct(ref);
             } catch (e) {
index 74b0eb27ba3627e8f0f73288a6f4bf1ee3ecde28..7e2950772d416d40856e731c599477de90d88ada 100644 (file)
@@ -78,13 +78,12 @@ FluidbookCart.prototype = {
 
         if (this.fluidbook.settings.cartLinkAppearance === 'overlay') {
             $('a[data-cart-ref]').each(function () {
-
                 var paddingTop = 0.5 * ($(this).outerHeight() - 100);
                 var paddingLeft = 0.5 * ($(this).outerWidth() - 250);
                 $(this).attr('data-tooltip', null).addClass('overlay').css({
                     paddingTop: paddingTop,
                     paddingLeft: paddingLeft
-                }).html('<div class="remove">' + getSpriteIcon('link-cart-remove') + getSpriteIcon('link-cart-remove-hover') + '</div><div class="add">' + getSpriteIcon('link-cart-add') + getSpriteIcon('link-cart-add-hover') + '</div>');
+                }).html('<div class="remove">' + getSpriteIcon('link-cart-remove') + getSpriteIcon('link-cart-remove-hover') + '</div><div class="add">' + getSpriteIcon('link-cart-add') + getSpriteIcon('link-cart-add-hover') + '</div><div class="infos">' + getSpriteIcon('link-cart-info')+'</div>');
             });
         }
     },
index 832bc4b64c2dec22f840c4f048ae1c8c3efb912d..b30420d280cd581c0e5326902b0b475ac78df355 100644 (file)
@@ -5,38 +5,52 @@ a[data-cart-ref] {
     color: #fff;
 
     div {
-      @w: 100px;
-      display: none;
-      position: relative;
-      width: @w;
-      height: @w;
+      &.infos {
+        @w: 50px;
+        width: @w;
+        height: @w;
+        position: absolute;
+        bottom: 50px;
+        right: 50px;
+        pointer-events: none;
+        display: none;
+      }
 
-      &:last-child {
+      @w: 100px;
+      &.add {
         margin-left: unit(@w*0.5, px);
       }
 
-      svg {
-        top: 0;
-        left: 0;
+      &.add, &.remove {
+        display: none;
+        position: relative;
         width: @w;
         height: @w;
-        overflow: visible;
-        position: absolute;
-        display: block;
 
-        &:first-child {
-          display: none;
-        }
-      }
 
-      &:hover {
         svg {
+          top: 0;
+          left: 0;
+          width: @w;
+          height: @w;
+          overflow: visible;
+          position: absolute;
+          display: block;
+
           &:first-child {
-            display: block;
+            display: none;
           }
+        }
 
-          &:last-child {
-            display: none;
+        &:hover {
+          svg {
+            &:first-child {
+              display: block;
+            }
+
+            &:last-child {
+              display: none;
+            }
           }
         }
       }