]> _ Git - fluidbook-html5.git/commitdiff
wait #2523 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 18 Jan 2019 17:22:00 +0000 (18:22 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 18 Jan 2019 17:22:00 +0000 (18:22 +0100)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.pagetransitions.js
js/libs/fluidbook/fluidbook.zoom.js

index ff44fd03d705b57a5001e252a13af06f07d5b203..fcd54c0bdb61d5128274e7172508ca1bbc2c508d 100644 (file)
@@ -35,11 +35,11 @@ Fluidbook.prototype = {
         }
         this.contentlock = new FluidbookContentLock(this);
         this.menu = new FluidbookMenu(this);
+        this.support = new FluidbookSupport(this);
         this.zoom = new FluidbookZoom(this);
         this.zoom.resetZoom();
         this.cache = new FluidbookCache(datas);
         this.service = new FluidbookService(this, datas.id);
-        this.support = new FluidbookSupport(this);
         this.loader = new FluidbookLoader(this);
         this.search = new FluidbookSearch(this);
         this.pad = new FluidbookPad(this);
index 2e23ba99d0aa5a89fd7b34150ebeb4e87c1f8981..5fee12f7ebd3cf8a397bc16efbf7159ca5f03146 100644 (file)
@@ -427,7 +427,6 @@ FluidbookPageTransition.prototype = {
         $(this.fluidbook).trigger('fluidbook.page.change.end', [this.fluidbook.currentPage]);
     },
 
-
     canChangePage: function () {
         return this.fluidbook.canNavigate && !this.transitionning;
     },
index ef0260b6d2b6101d14ea25319649b1f28ea6bc85..d5b004073fcb0d8acbcb6cde2c6c9a985b49ffc8 100644 (file)
@@ -5,6 +5,7 @@ function FluidbookZoom(fluidbook) {
     this.originpx = ['0px', '0px'];
     this.max = this.fluidbook.datas.zoomw / 100;
     this.transition = true;
+    this.shadowTimeout;
     this.hideInterfaceTimeout;
     this.init();
 }
@@ -19,8 +20,17 @@ FluidbookZoom.prototype = {
         });
 
         // Detect when we have finished zooming out and raise an event
-        $("#z").on('transitionend', function () {
-            $this.triggerEvent((($this.zoom == 1) ? 'out' : 'in') + '.end');
+        $("#z").on(this.fluidbook.support.transitionEndEvent, function () {
+            $this.triggerEvent((($this.zoom === 1) ? 'out' : 'in') + '.end');
+        });
+
+        $(this.fluidbook).on('fluidbook.zoom.out.end,fluidbook.zoom.in.end', function () {
+            clearTimeout($this.shadowTimeout);
+            if ($this.zoom === 1) {
+                $("#shadow").removeClass('hidden');
+            } else {
+                $("#shadow").addClass('hidden');
+            }
         });
 
     },
@@ -70,7 +80,6 @@ FluidbookZoom.prototype = {
             }
         }
         if (this.zoom == zoom) {
-
             return;
         }
         this.zoom = zoom;
@@ -96,13 +105,13 @@ FluidbookZoom.prototype = {
     resetZoom: function (callback) {
 
         if (this.zoom === 1) {
-            if(callback){
+            if (callback) {
                 callback();
             }
             return;
         }
         this.setZoom(1, -1);
-        if(callback) {
+        if (callback) {
             setTimeout(function () {
                 callback();
             }, 350);
@@ -164,6 +173,7 @@ FluidbookZoom.prototype = {
 
     updateZoom: function () {
         var $this = this;
+        clearTimeout(this.shadowTimeout);
 
         if (this.zoom > 1) {
             $("#z").removeClass('nozoom')
@@ -193,7 +203,7 @@ FluidbookZoom.prototype = {
         } else {
             clearTimeout(this.hideInterfaceTimeout);
             $(hiddenElements).show().removeClass('hidden');
-            setTimeout(function () {
+            this.shadowTimeout = setTimeout(function () {
                 $("#shadow").removeClass('hidden');
             }, 250);