From a51846e536be6328b9c1d8c3df2272f146963171 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Thu, 29 Oct 2015 22:31:40 -0300 Subject: [PATCH] zoom factor decreased, fixing some js errors due to legacy code --- mindplot/src/main/javascript/Designer.js | 26 +++---------------- .../src/main/webapp/jsp/mindmapEmbed.jsp | 8 ------ .../src/main/webapp/jsp/mindmapPrint.jsp | 8 ------ 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 8b7c4368..ea9b2e14 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -82,32 +82,14 @@ mindplot.Designer = new Class(/** @lends Designer */{ * @private */ _registerWheelEvents: function () { - var workspace = this._workspace; + var zoomFactor = 1.006; var me = this; // Zoom In and Zoom Out must active event $(document).on('mousewheel', function (event) { - // Change mousewheel handling so we let the default - // event happen if we are outside the container. -> FIXME: it still happening? - /*var coords = screenManager.getContainer().getCoordinates(); - var isOutsideContainer = event.client.y < coords.top || - event.client.y > coords.bottom || - event.client.x < coords.left || - event.client.x > coords.right; - - if (!isOutsideContainer) { - if (event.wheel > 0) { - this.zoomIn(1.05); - } - else { - this.zoomOut(1.05); - } - event.preventDefault(); - }*/ if (event.deltaY > 0) { - me.zoomIn(1.05); - } - else { - me.zoomOut(1.05); + me.zoomIn(zoomFactor); + } else { + me.zoomOut(zoomFactor); } event.preventDefault(); }); diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEmbed.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEmbed.jsp index cf0b94a4..503327ae 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEmbed.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEmbed.jsp @@ -58,14 +58,6 @@ var persistence = mindplot.PersistenceManager.getInstance(); var mindmap = mindmap = persistence.load(mapId); designer.loadMap(mindmap); - - $('zoomIn').addEvent('click', function () { - designer.zoomIn(); - }); - - $('zoomOut').addEvent('click', function () { - designer.zoomOut(); - }); }); diff --git a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp index c8e8cc19..f80a8f13 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp @@ -90,14 +90,6 @@ var persistence = mindplot.PersistenceManager.getInstance(); var mindmap = mindmap = persistence.load(mapId); designer.loadMap(mindmap); - - $('zoomIn').addEvent('click', function () { - designer.zoomIn(); - }); - - $('zoomOut').addEvent('click', function () { - designer.zoomOut(); - }); });