]> _ Git - fluidbook-html5.git/commitdiff
Merge remote-tracking branch 'origin/master' into diaporama
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 Jun 2018 12:44:28 +0000 (14:44 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 Jun 2018 12:44:28 +0000 (14:44 +0200)
# Conflicts:
# js/libs/fluidbook/fluidbook.js
# js/libs/fluidbook/fluidbook.menu.js

1  2 
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.menu.js

index 6d52f0e0305b238be8bc1a01469a7dfd65b60d64,7f2fa5ee7c98f376fb321f40f1f2f76dc2db4f30..cdc05c7338e4329a9db78d33da9f3528c1592bfe
@@@ -54,8 -56,9 +56,11 @@@ Fluidbook.prototype = 
          this.tooltip = new FluidbookTooltip(this);
          this.audiodescription = new FluidbookAudioDescription(this);
          this.sound = new FluidbookSound(this);
 +        this.slideshow = new FluidbookSlideshow(this);
 +
+         if(this.datas.basket) {
+             this.cart = new FluidbookCart(this);
+         }
          if (this.datas.form == 'bulle') {
              this.form = new FluidbookBulleForm(this);
          } else {
index c4d5ca3a2281897eabd4b79c460ef041b2b2c786,4a57cfea94fd594e25ae143d8ecc9ac6828e2073..fdcf3f545d3747bead3f9aeb084a7f9d21ff60b7
@@@ -580,45 -581,30 +612,63 @@@ FluidbookMenu.prototype = 
  
  
                  if (s < 1) {
-                     var css = {overflow: 'hidden', width: nw * s, height: nh * s, top: y, left: x, position: 'absolute'};
+                     var css = {
+                         overflow: 'hidden',
+                         width: nw * s,
+                         height: nh * s,
+                         top: y,
+                         left: x,
+                         position: 'absolute'
+                     };
                      m.find('.multimediaHolder').css(css);
                  } else {
-                     m.find('.multimediaHolder').css({position: "", overflow: '', width: '', height: '', top: '', left: ''});
+                     m.find('.multimediaHolder').css({
+                         position: "",
+                         overflow: '',
+                         width: '',
+                         height: '',
+                         top: '',
+                         left: ''
+                     });
                  }
  
+                 m.find('.multimediaScale').css({width: nw, height: nh, overflow: 'hidden'}).transform({
+                     scale: [s, s],
+                     origin: [0, 0]
+                 }).css('text-align', 'left');
 +                m.find('.multimediaScale').css({width: nw, height: nh, overflow: 'hidden'}).transform({scale: [s, s], origin: [0, 0]}).css('text-align', 'left');
 +                break;
 +          case 'slideshow':
 +
 +                    // When resizing the slideshow, the goal is to fit it into the maximum modal height (stored in 'h').
 +                    // The thumbnails and caption can't be scaled so we must scale the height of the main image
 +                    // (it is already scaled for max-width via CSS)
 +
 +                    var headerHeight = m.find('.caption').outerHeight(), // Height of title section that also contains close button
 +                        thumbnailsHeight = m.find('.fb-slideshow-thumbnails').outerHeight(), // Thumbnail slider height
 +                        slideMaxHeight = h - headerHeight - thumbnailsHeight; // Remaining height that main image + caption has to fit into
 +
 +                    // Process each slide and calculate optimal height for image and slide container
 +                    m.find('.fb-slideshow-slide').each(function() {
 +
 +                        // Set the height on this container so flexbox can vertically center
 +                        // the contents when they don't take up the full height available
 +                        $(this).css('height', slideMaxHeight);
 +
 +                        var captionHeight = $(this).find('.fb-slideshow-slide-caption').outerHeight() || 0;
 +
 +                        // Allow image to take up whatever height is left after accounting for the caption
 +                        // This is only the max-height so the image might not end up being this tall...
 +                        $(this).find('.fb-slideshow-slide-image').css({
 +                            'max-height': slideMaxHeight - captionHeight
 +                        });
 +                    });
 +
 +                    // setTimeout(function() {
 +                    //   var slideshowID = m.find('.fb-slideshow').attr('id');
 +                    //   $('#' + slideshowID).find('.fb-slideshow-slide').css('visibility', 'visible');
 +                    // }, 100)
 +
                  break;
              default:
                  break;