]> _ Git - fluidbook-html5.git/commitdiff
wip #1911 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 18 Jul 2018 16:46:51 +0000 (18:46 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 18 Jul 2018 16:46:51 +0000 (18:46 +0200)
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.resize.js

index 38d89205f86e9a85ad3949cb8cc1852764c9c578..7262a087cc8ee6a1e3da4072435bbbf2754b0be9 100644 (file)
@@ -33,6 +33,9 @@ FluidbookLinks.prototype = {
             $this.zoomLinkReset(true);
         });
 
+        $(this.fluidbook).on('fluidbook.resize', function () {
+            $this.resize();
+        });
 
         $(document).on('click', '#zoomPopupOverlay, #zoomPopupWrapper,  #zoomPopupClose', function (e) {
             $this.zoomLinkReset();
@@ -145,6 +148,7 @@ FluidbookLinks.prototype = {
         }, 200);
         $(fluidbook).trigger('fluidbooklinksready');
         $(fluidbook).trigger('fluidbook.links.ready');
+        this.resize();
     },
 
 
@@ -373,4 +377,17 @@ FluidbookLinks.prototype = {
         });
     },
 
+    resize: function () {
+        var $this = this;
+        $("#links .link.iframe").each(function () {
+            var w = $(this).outerWidth();
+            var h = $(this).outerHeight();
+            var iw = w * $this.fluidbook.resize.bookScale;
+            var ih = h * $this.fluidbook.resize.bookScale;
+            $("iframe").attr("width", iw)
+                .attr('height', ih)
+                .css({width: iw, height: ih, transform: 'scale(' + (1 / $this.fluidbook.resize.bookScale) + ')'});
+        });
+    },
+
 }
index d2b60eb472ff076377701a86cf2d1ea526aae0d2..8fcf0f14f7a27c470f32da1fb2024627f49ae5ce 100644 (file)
@@ -257,6 +257,7 @@ FluidbookResize.prototype = {
             ww: this.ww,
             hh: this.hh,
             orientation: this.orientation,
+            bookScale:this.bookScale,
             fluidbookrect: $("#fluidbook").get(0).getBoundingClientRect()
         });
     },