]> _ Git - fluidbook-html5.git/commitdiff
wait #4547 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 21 Jun 2021 13:15:38 +0000 (15:15 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 21 Jun 2021 13:15:38 +0000 (15:15 +0200)
js/libs/fluidbook/links/fluidbook.links.zoomhd.js

index f5aaf9747d8d1379efa1a8d8a257f9a72d3705ba..1cd7a7ce253e5c27562017cfc5a042f2e3812f8d 100644 (file)
@@ -57,6 +57,9 @@ FluidbookLinksZoomHD.prototype = {
         });
 
         $(document).on('mousewheel', function (e) {
+            if(this.element===undefined){
+                return true;
+            }
             var s = $this.scale;
             s += 0.25 * e.deltaY;
             $this.scale = $this.normalizeScale(s);
@@ -164,6 +167,9 @@ FluidbookLinksZoomHD.prototype = {
     },
 
     setMovePos: function (x, y) {
+        if(this.element===undefined){
+            return;
+        }
         x = Math.max(this.dragMinX, Math.min(this.dragMaxX, x));
         y = Math.max(this.dragMinY, Math.min(this.dragMaxY, y));
 
@@ -191,6 +197,9 @@ FluidbookLinksZoomHD.prototype = {
     },
 
     resize: function () {
+        if(this.element===undefined){
+            return;
+        }
         this.element.closest('.zoomhdRefScale').css({transform: 'scale(' + this.refScale + ')'});
         this.element.css({transform: 'scale(' + this.scale + ')'});
         this.currentImageWidth = this.initialImageWidth * this.scale;