From: Vincent Vanwaelscappel Date: Tue, 17 Oct 2017 16:41:12 +0000 (+0200) Subject: wip #1748 @6 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1c2cf5aef1125f0e249ae1413b17bd0a74218974;p=fluidbook-html5.git wip #1748 @6 --- diff --git a/js/libs/fluidbook/fluidbook.loader.js b/js/libs/fluidbook/fluidbook.loader.js index 79ab0256..7f599a2b 100644 --- a/js/libs/fluidbook/fluidbook.loader.js +++ b/js/libs/fluidbook/fluidbook.loader.js @@ -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); } diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index ad998d9c..193cefc4 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -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. diff --git a/js/libs/fluidbook/fluidbook.resize.js b/js/libs/fluidbook/fluidbook.resize.js index 68c63344..d09a5073 100644 --- a/js/libs/fluidbook/fluidbook.resize.js +++ b/js/libs/fluidbook/fluidbook.resize.js @@ -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(), diff --git a/js/libs/fluidbook/fluidbook.video.js b/js/libs/fluidbook/fluidbook.video.js index a3506958..1a1e0175 100644 --- a/js/libs/fluidbook/fluidbook.video.js +++ b/js/libs/fluidbook/fluidbook.video.js @@ -12,7 +12,7 @@ function FluidbookVideo(fluidbook) { $this.removeAllVideos(); }); - $(window).on('fluidbookresize', function (e) { + $(fluidbook).on('fluidbook.resize', function (e) { $this.resizeControls(); }); diff --git a/js/libs/fluidbook/special/wescosales.js b/js/libs/fluidbook/special/wescosales.js index cc042ffa..c8b7fbb3 100644 --- a/js/libs/fluidbook/special/wescosales.js +++ b/js/libs/fluidbook/special/wescosales.js @@ -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() { diff --git a/style/fluidbook.less b/style/fluidbook.less index 0fe04cc7..8dc9c8f5 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -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 {