Skip to content

Commit 254a00f

Browse files
committed
- Fixed bug:'touchmove' event no longer fired after cancelling movement onSlideLeave alvarotrigo#2406
1 parent 4189a96 commit 254a00f

File tree

1 file changed

+25
-29
lines changed

1 file changed

+25
-29
lines changed

jquery.fullPage.js

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,45 +1103,41 @@
11031103
}
11041104

11051105
var scrollable = options.scrollOverflowHandler.scrollable(activeSection);
1106+
var touchEvents = getEventsPage(e);
1107+
1108+
touchEndY = touchEvents.y;
1109+
touchEndX = touchEvents.x;
1110+
1111+
//if movement in the X axys is greater than in the Y and the currect section has slides...
1112+
if (activeSection.find(SLIDES_WRAPPER_SEL).length && Math.abs(touchStartX - touchEndX) > (Math.abs(touchStartY - touchEndY))) {
11061113

1107-
if (canScroll && !slideMoving) { //if theres any #
1108-
var touchEvents = getEventsPage(e);
1109-
1110-
touchEndY = touchEvents.y;
1111-
touchEndX = touchEvents.x;
1112-
1113-
//if movement in the X axys is greater than in the Y and the currect section has slides...
1114-
if (activeSection.find(SLIDES_WRAPPER_SEL).length && Math.abs(touchStartX - touchEndX) > (Math.abs(touchStartY - touchEndY))) {
1115-
1116-
//is the movement greater than the minimum resistance to scroll?
1117-
if (Math.abs(touchStartX - touchEndX) > ($window.outerWidth() / 100 * options.touchSensitivity)) {
1118-
if (touchStartX > touchEndX) {
1119-
if(isScrollAllowed.m.right){
1120-
moveSlideRight(activeSection); //next
1121-
}
1122-
} else {
1123-
if(isScrollAllowed.m.left){
1124-
moveSlideLeft(activeSection); //prev
1125-
}
1114+
//is the movement greater than the minimum resistance to scroll?
1115+
if (!slideMoving && Math.abs(touchStartX - touchEndX) > ($window.outerWidth() / 100 * options.touchSensitivity)) {
1116+
if (touchStartX > touchEndX) {
1117+
if(isScrollAllowed.m.right){
1118+
moveSlideRight(activeSection); //next
1119+
}
1120+
} else {
1121+
if(isScrollAllowed.m.left){
1122+
moveSlideLeft(activeSection); //prev
11261123
}
11271124
}
11281125
}
1126+
}
11291127

1130-
//vertical scrolling (only when autoScrolling is enabled)
1131-
else if(options.autoScrolling){
1128+
//vertical scrolling (only when autoScrolling is enabled)
1129+
else if(options.autoScrolling && canScroll){
11321130

1133-
//is the movement greater than the minimum resistance to scroll?
1134-
if (Math.abs(touchStartY - touchEndY) > ($window.height() / 100 * options.touchSensitivity)) {
1135-
if (touchStartY > touchEndY) {
1136-
scrolling('down', scrollable);
1137-
} else if (touchEndY > touchStartY) {
1138-
scrolling('up', scrollable);
1139-
}
1131+
//is the movement greater than the minimum resistance to scroll?
1132+
if (Math.abs(touchStartY - touchEndY) > ($window.height() / 100 * options.touchSensitivity)) {
1133+
if (touchStartY > touchEndY) {
1134+
scrolling('down', scrollable);
1135+
} else if (touchEndY > touchStartY) {
1136+
scrolling('up', scrollable);
11401137
}
11411138
}
11421139
}
11431140
}
1144-
11451141
}
11461142

11471143
/**

0 commit comments

Comments
 (0)