mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 22:27:55 +01:00
Minor fix to have a single point of exit.
This commit is contained in:
parent
699fda21d2
commit
6a1484b49d
@ -118,21 +118,22 @@ mindplot.Designer = new Class({
|
|||||||
|
|
||||||
|
|
||||||
$(document).addEvent('mousewheel', function(event) {
|
$(document).addEvent('mousewheel', function(event) {
|
||||||
var containerCoords = screenManager.getContainer().getCoordinates();
|
// Change mousewheel handling so we let the default
|
||||||
if (event.client.y < containerCoords.top ||
|
//event happen if we are outside the container.
|
||||||
event.client.y > containerCoords.bottom ||
|
var coords = screenManager.getContainer().getCoordinates();
|
||||||
event.client.x < containerCoords.left ||
|
var isOutsideContainer = event.client.y < coords.top ||
|
||||||
event.client.x > containerCoords.right
|
event.client.y > coords.bottom ||
|
||||||
) {
|
event.client.x < coords.left ||
|
||||||
return true;
|
event.client.x > coords.right;
|
||||||
}
|
|
||||||
|
|
||||||
event.preventDefault();
|
if (!isOutsideContainer) {
|
||||||
if (event.wheel > 0) {
|
if (event.wheel > 0) {
|
||||||
this.zoomIn(1.05);
|
this.zoomIn(1.05);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.zoomOut(1.05);
|
this.zoomOut(1.05);
|
||||||
|
}
|
||||||
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user