From 4b3a00f2e88d021267b4b52f5c9e9930ba9e0353 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Tue, 13 May 2014 02:22:42 -0300 Subject: [PATCH] fix scrollbar zoom in / zoom out --- mindplot/src/main/javascript/Designer.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index ba7754b1..49b59c5c 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -80,13 +80,12 @@ mindplot.Designer = new Class({ _registerWheelEvents:function () { var workspace = this._workspace; - var screenManager = workspace.getScreenManager(); - + var me = this; // Zoom In and Zoom Out must active event - $(document).bind('mousewheel', function (event) { + $(document).on('mousewheel', function (event) { // Change mousewheel handling so we let the default - //event happen if we are outside the container. - var coords = screenManager.getContainer()[0].getCoordinates(); + // 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 || @@ -100,8 +99,15 @@ mindplot.Designer = new Class({ this.zoomOut(1.05); } event.preventDefault(); + }*/ + if (event.deltaY > 0) { + me.zoomIn(1.05); } - }.bind(this)); + else { + me.zoomOut(1.05); + } + event.preventDefault(); + }); }, /**