]> _ Git - fluidbook-html5.git/commitdiff
wip #1748 @6
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 Oct 2017 16:41:12 +0000 (18:41 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 17 Oct 2017 16:41:12 +0000 (18:41 +0200)
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.nav.js
js/libs/fluidbook/fluidbook.resize.js
js/libs/fluidbook/fluidbook.video.js
js/libs/fluidbook/special/wescosales.js
style/fluidbook.less

index 79ab0256cae7229b6e48909ff93cebe85337f2bb..7f599a2bf2f6fba18ae5d5272b56ed796da7e546 100644 (file)
@@ -49,7 +49,8 @@ FluidbookLoader.prototype = {
             } else {
                 $this.preloadPagesBeforeTransition($pages, $callback);
             }
-        })
+        });
+
     },
     preloadPages: function () {
         if (this.toPreload.length == 0) {
@@ -303,10 +304,14 @@ FluidbookLoader.prototype = {
     loadImage: function (src, width, height, type, callback) {
         var img = new Image();
         var $this = this;
+        var callbackCalled=false;
         if (callback && typeof callback == 'function') {
             $(img).one('load', function () {
                 setTimeout(function () {
-                    callback();
+                    if(!callbackCalled) {
+                        callbackCalled = true;
+                        callback();
+                    }
                 }, 10);
             });
         }
@@ -328,7 +333,10 @@ FluidbookLoader.prototype = {
         }
         if (callback && typeof callback == 'function' && (img.complete || img.readyState == 'complete' || img.readyState == 4)) {
             setTimeout(function () {
-                callback();
+                if(!callbackCalled) {
+                    callbackCalled = true;
+                    callback();
+                }
             }, 10);
         }
 
index ad998d9c6697ed5e9c6974277151110cc5db4218..193cefc493a0121c2abe4bee56cedd0ffac8c3ce 100644 (file)
@@ -74,7 +74,7 @@ FluidbookNav.prototype = {
         });
 
         // Recalculate available size for menu search results
-        $(window).on('fluidbookresize', this.fluidbook.resize.resizeMenu);
+        $(this.fluidbook).on('fluidbook.resize', this.fluidbook.resize.resizeMenu);
 
         // Handle swipe to close (it's only really practical to have this because swipe to open would interfere with main Fluidbook swipes)
         // We are not using MMenu's "Drag" add-on because it doesn't close the main menu, only submenus on swipe.
index 68c6334496ea38c9013bccbe021840a0f651f4c7..d09a5073e298f2b2065cfe3e2e8e0e20c45efdca 100644 (file)
@@ -53,7 +53,6 @@ FluidbookResize.prototype = {
             init = false;
         }
 
-
         var $this = this;
         this.updateWindow();
         this.handleOrientation();
@@ -225,8 +224,7 @@ FluidbookResize.prototype = {
         }
 
         $(window).scrollTop(0);
-        $(window).trigger('fluidbookresize');
-        $(this.fluidbook).trigger('fluidbook.resize', {ww: this.ww, wh: this.wh, orientation: this.orientation, fluidbookrect: $("#fluidbook").get(0).getBoundingClientRect()});
+        $(this.fluidbook).trigger('fluidbook.resize', {ww: this.ww, hh: this.hh, orientation: this.orientation, fluidbookrect: $("#fluidbook").get(0).getBoundingClientRect()});
     },
     resizeNav: function (interfaceScale) {
         var topNext = (this.hh - (100 * interfaceScale)) / 2;
@@ -307,13 +305,16 @@ FluidbookResize.prototype = {
             $(this.fluidbook).trigger('fluidbook.resize.beforeOrientationChange');
             this.fluidbook.zoom.resetZoom();
             this.fluidbook.pageTransition();
-            $(this.fluidbook).trigger('fluidbook.resize.orientation', this.orientation);
+            $(this.fluidbook).trigger('fluidbook.resize.orientation', {orientation: this.orientation});
         }
     },
     getScreenFluidbookWidth: function () {
         return $("#fluidbook").outerWidth() * fluidbook.resize.bookScale;
     },
     resizeMenu: function () {
+        if (this.fluidbook == undefined) {
+            return false;
+        }
         if (!this.fluidbook.nav.menuIsOpen) return false;
 
         var wh = $(window).height(),
index a35069581fc8de8a966d76dfd54cf3a9c6dc7a4a..1a1e0175c1154c18e027d963fc894490c83931f4 100644 (file)
@@ -12,7 +12,7 @@ function FluidbookVideo(fluidbook) {
         $this.removeAllVideos();
     });
 
-    $(window).on('fluidbookresize', function (e) {
+    $(fluidbook).on('fluidbook.resize', function (e) {
         $this.resizeControls();
     });
 
index cc042ffa5346d3cbd2aaf426ae5d596dacd2a8ea..c8b7fbb37d31593022c7e301f999383883d8b60d 100644 (file)
@@ -4,7 +4,7 @@ $(function () {
     $(fluidbook).on('fluidbookready', initWesco);
     $(fluidbook).on('fluidbooknavready', initWescoNav);
     $(fluidbook).on('fluidbooklinksready', wescoLinksReady);
-    $(window).on('fluidbookresize', wescoResize);
+    $(fluidbook).on('fluidbook.resize', wescoResize);
 });
 
 function initWescoNav() {
index 0fe04cc763af2a6b13180b7d8fd5612bdee0114d..8dc9c8f53d1db25d27665a3fc5437fc9183699ba 100644 (file)
@@ -591,12 +591,6 @@ body, html {
        z-index: 11;
        direction: ltr;
 
-       -moz-transition: -moz-transform @zoomtransition ease-out, transform @zoomtransition ease-out;
-       -webkit-transition: -webkit-transform @zoomtransition ease-out, transform @zoomtransition ease-out;
-       -o-transition: -o-transform @zoomtransition ease-out, transform @zoomtransition ease-out;
-       -ms-transition: -ms-transform @zoomtransition ease-out, transform @zoomtransition ease-out;
-       transition: transform @zoomtransition ease-out;
-
        &.animate {
                -moz-transition: all @zoomtransition ease-out;
                -webkit-transition: all @zoomtransition ease-out;
@@ -876,11 +870,11 @@ footer, header, #interface {
 #shadow {
        @shadow-zoom-transition: 400ms;
 
-       -moz-transition: -moz-transform @zoomtransition ease-out, transform @zoomtransition ease-out, opacity @shadow-zoom-transition ease-in, visibility @shadow-zoom-transition ease-in;
-       -webkit-transition: -webkit-transform @zoomtransition ease-out, transform @zoomtransition ease-out, opacity @shadow-zoom-transition ease-in, visibility @shadow-zoom-transition ease-in;
-       -o-transition: -o-transform @zoomtransition ease-out, transform @zoomtransition ease-out, opacity @shadow-zoom-transition ease-in, visibility @shadow-zoom-transition ease-in;
-       -ms-transition: -ms-transform @zoomtransition ease-out, transform @zoomtransition ease-out, opacity @shadow-zoom-transition ease-in, visibility @shadow-zoom-transition ease-in;
-       transition: transform @zoomtransition ease-out, opacity @shadow-zoom-transition ease-in, visibility @shadow-zoom-transition ease-in;
+       -moz-transition: opacity @shadow-zoom-transition ease-in, visibility @shadow-zoom-transition ease-in;
+       -webkit-transition: opacity @shadow-zoom-transition ease-in, visibility @shadow-zoom-transition ease-in;
+       -o-transition: opacity @shadow-zoom-transition ease-in, visibility @shadow-zoom-transition ease-in;
+       -ms-transition: opacity @shadow-zoom-transition ease-in, visibility @shadow-zoom-transition ease-in;
+       transition: opacity @shadow-zoom-transition ease-in, visibility @shadow-zoom-transition ease-in;
 
        &.animate {
                -moz-transition: all @zoomtransition ease-out;
@@ -1548,7 +1542,6 @@ ul.chapters.shareList a.level0 .svg-icon {
        color: transparent;
 }
 
-
 #helpView .interface > div {
        position: absolute;
        direction: ltr;
@@ -2316,6 +2309,25 @@ body > input {
        }
 }
 
+.links .link.multimedia {
+       .tabs {
+               transition: opacity 400ms;
+               position: relative;
+               &.hidezoomin, &.hideportrait, &.hidelastpage, &.hidefirstpage {
+                       opacity: 0;
+               }
+
+               .tablink {
+                       position: absolute;
+                       width: 100%;
+                       height: 100%;
+                       top: 0;
+                       left: 0;
+                       display: block;
+               }
+       }
+}
+
 /* Webfonts*/
 
 @font-face {