From 70bdc8839e713486d90e322365e1f68fb0a54779 Mon Sep 17 00:00:00 2001 From: Jose Date: Mon, 20 Feb 2017 20:23:25 +0100 Subject: [PATCH] Some issues solved --- .eslintrc.json | 4 ---- src/mousetracker.js | 10 +++++----- src/viewer.js | 9 ++++----- src/viewport.js | 2 +- test/demo/constrainedpan.html | 2 +- test/demo/{embed.html => iframe-embed.html} | 5 ++--- test/demo/{iframe.html => iframe-host.html} | 7 +++---- 7 files changed, 16 insertions(+), 23 deletions(-) rename test/demo/{embed.html => iframe-embed.html} (94%) rename test/demo/{iframe.html => iframe-host.html} (70%) diff --git a/.eslintrc.json b/.eslintrc.json index fe8e34e6..35c702a5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,10 +8,6 @@ "off", 4 ], - //"linebreak-style": [ - // "error", - // "unix" - //], "quotes": [ "off", "double" diff --git a/src/mousetracker.js b/src/mousetracker.js index e9d5f0e9..0480300a 100644 --- a/src/mousetracker.js +++ b/src/mousetracker.js @@ -870,12 +870,12 @@ * @memberof OpenSeadragon.MouseTracker */ $.MouseTracker.resetAllMouseTrackers = function(){ - MOUSETRACKERS.forEach(function(mt){ - if (mt.isTracking()){ - mt.setTracking(false); - mt.setTracking(true); + for(var i = 0; i < MOUSETRACKERS.length; i++){ + if (MOUSETRACKERS[i].isTracking()){ + MOUSETRACKERS[i].setTracking(false); + MOUSETRACKERS[i].setTracking(true); } - }); + } }; /** diff --git a/src/viewer.js b/src/viewer.js index b3a51d03..68c3d9a0 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -2530,7 +2530,6 @@ function onCanvasDblClick( event ) { }); } -// Modified to improve constrained panning function onCanvasDrag( event ) { var gestureSettings; @@ -2546,14 +2545,14 @@ function onCanvasDrag( event ) { if( this.constrainDuringPan ){ var delta = this.viewport.deltaPointsFromPixels( event.delta.negate() ); - this["viewport"].centerSpringX.target.value += delta.x; - this["viewport"].centerSpringY.target.value += delta.y; + this.viewport.centerSpringX.target.value += delta.x; + this.viewport.centerSpringY.target.value += delta.y; var bounds = this.viewport.getBounds(); var constrainedBounds = this.viewport.getConstrainedBounds(); - this["viewport"].centerSpringX.target.value -= delta.x; - this["viewport"].centerSpringY.target.value -= delta.y; + this.viewport.centerSpringX.target.value -= delta.x; + this.viewport.centerSpringY.target.value -= delta.y; if (bounds.x != constrainedBounds.x) { event.delta.x = 0; diff --git a/src/viewport.js b/src/viewport.js index bc06530e..cb534b68 100644 --- a/src/viewport.js +++ b/src/viewport.js @@ -734,7 +734,7 @@ $.Viewport.prototype = { /** - * Returns bounds taking constrains into account + * Returns bounds taking constraints into account * Added to improve constrained panning * @param {Boolean} immediately * @return {OpenSeadragon.Viewport} Chainable. diff --git a/test/demo/constrainedpan.html b/test/demo/constrainedpan.html index 0b64eef1..1cd7578a 100644 --- a/test/demo/constrainedpan.html +++ b/test/demo/constrainedpan.html @@ -45,4 +45,4 @@ }); - + \ No newline at end of file diff --git a/test/demo/embed.html b/test/demo/iframe-embed.html similarity index 94% rename from test/demo/embed.html rename to test/demo/iframe-embed.html index 07dfb66c..33a34b45 100644 --- a/test/demo/embed.html +++ b/test/demo/iframe-embed.html @@ -1,8 +1,7 @@ - - CartoWall Climbing Topo + Iframe example embed @@ -30,4 +29,4 @@ }); - + \ No newline at end of file diff --git a/test/demo/iframe.html b/test/demo/iframe-host.html similarity index 70% rename from test/demo/iframe.html rename to test/demo/iframe-host.html index 375cbdee..ea602473 100644 --- a/test/demo/iframe.html +++ b/test/demo/iframe-host.html @@ -1,8 +1,7 @@ - - CartoWall Climbing Topo + Iframe example @@ -14,6 +13,6 @@ - + - + \ No newline at end of file