1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-08-29 16:00:31 +02:00

Fixing issue with scrolling

This commit is contained in:
Antonio Laguna
2017-02-27 20:24:56 +01:00
parent 14e1b5b7b8
commit ebe42090ac
3 changed files with 10 additions and 7 deletions

View File

@@ -1396,7 +1396,7 @@ var Scroll = function () {
this.timeout_ = setTimeout(function () {
_this.timeout_ = null;
}, 500);
}, 450);
}
/**
@@ -1417,12 +1417,13 @@ var Scroll = function () {
var wheelDeltaY = event.deltaY,
wheelDeltaX = event.deltaX;
var isVertical = this.ws_.isVertical;
this.isGoingUp_ = wheelDeltaY < 0;
this.isGoingLeft_ = wheelDeltaX < 0;
// If we're mainly moving horizontally, prevent default
if (Math.abs(wheelDeltaX) > Math.abs(wheelDeltaY)) {
if (!this.ws_.isVertical) {
if (!isVertical) {
event.preventDefault();
} else {
// If we're moving horizontally but this is vertical, return to avoid
@@ -1432,7 +1433,7 @@ var Scroll = function () {
}
if (Math.abs(wheelDeltaY) >= MIN_WHEEL_DELTA || Math.abs(wheelDeltaX) >= MIN_WHEEL_DELTA) {
if (this.isGoingUp_ || this.isGoingLeft_) {
if (isVertical && this.isGoingUp_ || !isVertical && this.isGoingLeft_) {
this.ws_.goPrev();
} else {
this.ws_.goNext();

File diff suppressed because one or more lines are too long